We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Basic 3D Camera Question
Page Index Toggle Pages: 1
Basic 3D Camera Question (Read 1240 times)
Basic 3D Camera Question
Mar 4th, 2010, 4:37pm
 
What do I need to do to have a free camera, completely movable, pitchable, rollable, and yawable? Basically like a plane in a flight simulator, not one that is locked on one axis, like a FPS player. I have a good deal of experience in 3d, but I am embarassed to say that I can't figure this out.

My question is about the best way to approach the math, and setting the camera in processing. The rest, like input and drawing, I already know. Thanks!
Re: Basic 3D Camera Question
Reply #1 - Mar 5th, 2010, 12:59am
 
I tried many things, but using the quaternions was the most efficient.

http://www.gamasutra.com/view/feature/3278/rotating_objects_using_quaternions.ph...

http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuater...

You could then produce the 4x4 Matrix for public PMatrix3D camera; in PGraphics3D. I'm not sure what is the best way to update this matrix, since it's problematic with the cameraInv.

Something like camera(PMatrix3D mat); would have been helpful in this case.
Re: Basic 3D Camera Question
Reply #2 - Mar 5th, 2010, 3:18am
 
You might like to try the OCD library it looks like it mioght do what you want.
.
Page Index Toggle Pages: 1