フィルターのクリア

Simulink 3D Animation: how to compute the projection matrix associated with the camera view in a virtual reality world?

3 ビュー (過去 30 日間)
I am using Simulink 3D Animation to model a virtual reality environment.
In MATLAB, how do I calculate the projection of the world in the same way as it is rendered on the screen?

採用された回答

MathWorks Support Team
MathWorks Support Team 2024 年 5 月 8 日 0:00
編集済み: MathWorks Support Team 2024 年 5 月 8 日 9:12
We will use the "Membrane" example for Simulink 3D Animation:
You can get the position and direction of the camera using the following code example:
>> wh = vrworld('membrane.wrl');
>> open(wh);
>> view(wh);
>> fig = get(wh, 'Figures');
>> dir = get(fig, 'CameraDirection');
>> pos = get(fig, 'CameraPosition');
You may need the Field Of View (FOV) of the camera.
First, get the name of the currently used viewpoint:
>> get(fig, 'Viewpoint')
If there is a viewpoint, get the FOV of each viewpoint:
>> vp = get(wh, 'Viewpoints');
>> getfield(vp, 'fieldOfView')
If there is no viewpoint, the FOV is set to the default value specified by the VRML Standard: 0.785398 radians (45 degrees).
Please refer to the following link for more information on the VRML standard:
 

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulation についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by