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 › camera orbit suggestion
Page Index Toggle Pages: 1
camera orbit suggestion? (Read 2089 times)
camera orbit suggestion?
May 6th, 2005, 4:20am
 
Hello all

I'm trying to make the camera orbit around a item in a sketch, but I'm failing miserably.
the object is at 0,0,0, and I'm using the camera eyeX, eyeY and eyeZ. My idea is to have a given radius between the object and the camera, and use simple trigonometry to get the eye coordinates.

But... it doesn't work. Using only the x axis, it works perfectly;

Quote:
rotx += (mouseX - pmouseX)/(PI*32);
eyeX = cos(rotx)*cam_radius;
eyeZ = sin(rotx)*cam_radius;


but when the y rotation takes place, what a mess... for the eyez value, I have to get either the sin of the x or the y rotation, that's the first pitfall.


Does anyone know a link with information about this or has any suggestion?

Thanks!

Re: camera orbit suggestion?
Reply #1 - May 6th, 2005, 4:29am
 
Re: camera orbit suggestion?
Reply #2 - May 6th, 2005, 8:52am
 
great! didn't know about it. I'll check it out.

Thanks
Re: camera orbit suggestion?
Reply #3 - May 6th, 2005, 9:16am
 
what can I say... it works! just saved me a few hours of late night programming. Thanks!
Re: camera orbit suggestion?
Reply #4 - May 7th, 2005, 12:35am
 
Well, this was a beautiful story. The kind of stuff I get excited about and the reason Processing and this board exists!
Page Index Toggle Pages: 1