Camera looking down the negative Z-Axis
11 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have been trying to use the PlotCamera code to plot a camera using the world coordinate system but it currently only plots in the camera coordinate system.
I essentially want to produce this:
The Camera is looking down the negative Z Direction.
It is commonly used in game developement and in languages like openGL.
I have tried for a long time but I think there is just a limitation in the code since when you pass it the proper inputs it turns out errors.
Please let me know,
Thank you.
0 件のコメント
回答 (2 件)
George Abrahams
2024 年 2 月 10 日
Hi @Alex Ruiz. This is equivalent to an 180 degree rotation around the camera's local X-axis. The position of the camera won't be affected.
If you're using quaternions to store the rotations, you can do it like this. Note that in this example, randrot is from the Navigation Toolbox, while the quaternion class is available in multiple different toolboxes.
% Generate 10 random quaternion rotations, as sample data.
cameraRotations = quaternion( randrot( 10, 1 ) )
% This quaternion represents an 180 degree rotation around the X-axis.
basisRotation = quaternion( [0 1 0 0] );
% Perform the rotation in each camera's local coordinate system.
cameraRotations = cameraRotations * basisRotation
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Support Package for USB Webcams についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!