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 & HelpPrograms › world space position relative to camera
Page Index Toggle Pages: 1
world space position relative to camera (Read 586 times)
world space position relative to camera
Jul 5th, 2007, 9:15pm
 
Hey guys, been a while since I've posted anything on the forum, or used P5 for that matter, but I'm nonetheless back!

Anyway, I've been looking around for a way to calculate a position in 3d world space relative to the camera's position and rotation. I know that with screenX/Y/Z() we can do the opposite and get a point on the screen relative to a point in space, and I'm not sure if modelX/Y/Z() can even help here, or if it's been fixed. So I've turned to using the camera's matrix, but I know very little about how to get this data out of that. Digging around has confused me even more.

Is this an easy thing to do? Thanks!
-Steve
Re: world space position relative to camera
Reply #1 - Jul 6th, 2007, 4:34pm
 
Well I found a work around for this problem if anyone's interest. Using OCD ( http://www.cise.ufl.edu/%7Ekdamkjer/processing/libraries/ocd/ ) I made the cameraX/Y/Z and targetX/Y/Z properties accessible outside of the class by changing private to public on their respective variables declarations inside Camera.java and stitched together a new jar. This gave me access to all the data i needed, and using this should also give me more control over my camera.

-Steve
Page Index Toggle Pages: 1