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 & HelpSyntax Questions › Camera transforms
Page Index Toggle Pages: 1
Camera transforms? (Read 699 times)
Camera transforms?
Oct 7th, 2006, 6:34pm
 
Hi,

I'd like to attach a camera to one of the objects in my latest sketch - whether directly or by applying the same transformation matrix - and I can't seem to figure out a way. Quite possibly I'm being really stupid, but anyway... there must be a way, right

(otherwise, I can always just calculate the position using trig, but I was so pleased with being able to do the whole thing just using simple transforms instead!)
Re: Camera transforms?
Reply #1 - Oct 7th, 2006, 6:56pm
 
The easiest way is with the camera(...) function:
http://processing.org/reference/camera_.html

If you know where in 3D space your object is, and what you want to look at it's very easy to use.
Re: Camera transforms?
Reply #2 - Oct 7th, 2006, 11:09pm
 
Well, yes... but I don't know where in 3D space my object is; I'm putting it there using a long series of transforms. Is there a way of finding out where in 3D space it ends up, without just calculating it?
Re: Camera transforms?
Reply #3 - Oct 21st, 2006, 4:00pm
 
So... before this drops right off the page, is there really no way of simply transforming the camera? Or getting the coordinates implied by the current model transformation matrix in order to apply them to the camera?
Re: Camera transforms?
Reply #4 - Oct 21st, 2006, 4:59pm
 
I think you're going to have to delve into the Processing source to find out how it stores the transformation matrix. I know there is printMatrix(); which will nicely print the values, but there's no getMatrix(); as far as I can tell, so I think you'll have ot go into the source and find out how printMatrix() gets the numbers, and see if you can pull them out from your sketch, and then work out what on earth they mean.
Page Index Toggle Pages: 1