How do you control both Horizontal and Vertical view angles in MATLAB's 3D viewer?
3 views (last 30 days)
Show older comments
I'm working on a simulation in which I need to simulate what a camera will see given a specific position and attitude. I've been able to do this with all the built in features using things like campos() and what not. However now I need to adjust MATLAB's "camera" to see with the same field of view as the one I'm trying to simulate. camva() almost does the trick, however it can only adjust for one angle, thus producing a "square" field of view.
I need to adjust both the camera's vertical and horizontal view angles (as the camera I am trying to simulate has a horizontal field of view of 120 degrees, and a vertical field of view of 30 degrees). Is this possible and how might I go about doing this?
1 Comment
Gaurav Ahuja
on 18 May 2017
You need to figure out if you would want to move the target point around the camera or the camera around the target point. other than what you have already used, I think the following two functions should help you achieve your goal.
view - You specify the viewpoint in terms of azimuth and elevation (https://www.mathworks.com/help/releases/R2016b/matlab/ref/view.html)
campan - Rotate camera target around camera position (https://www.mathworks.com/help/releases/R2016b/matlab/ref/campan.html)
Answers (0)
See Also
Categories
Find more on Camera Views in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!