MATLAB Answers

Camera looking down the negative Z-Axis

13 views (last 30 days)
Alex Ruiz
Alex Ruiz on 3 Nov 2019
Commented: Alex Ruiz on 8 Nov 2019
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 Comments

Sign in to comment.

Answers (1)

Qu Cao
Qu Cao on 7 Nov 2019
Edited: Qu Cao on 7 Nov 2019
Hi Alex,
In Computer Vision Toolbox we use the y-down/z-forward camera coordinate systems:
You can convert your coordinates [x1, y1, z1] to the one used in CVT [x2, y2, z2] as follows:
x2 = x1;
y2 =-y1;
z2 =-z1;
Thanks,
Qu

  1 Comment

Alex Ruiz
Alex Ruiz on 8 Nov 2019
Hello, I appreciate the responce!
Im using this for a robust application using multiple cameras in different quadrants. Adding the negative sign to the code isnt the best practice, since this code is the ground truth for another project. I am relaying on camera matrix/oriention matrix/translation vectors for position and rendering.
is there any other way?
I have found this to be a huge road block for my research field.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by