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.
Page Index Toggle Pages: 1
3d translate() (Read 723 times)
3d translate()
Jul 15th, 2009, 3:51pm
 
I have some data that I want to plot which is not centered at all.  I can easily move the data to the center of the screen by calculating its center on the x and y direction and calling translate((getWidth()/2.0)-meanx, (getHeight()/2.0)-meany, z).  However, I'm having a lot of trouble getting the data zoomed properly with the third parameter of translate().  I can calculate the max/min x value and max/min y value of the data that I want to plot... but how do I set the z value of translate() so that everything is just within view?

Thanks!
Re: 3d translate()
Reply #1 - Jul 16th, 2009, 5:47am
 
Translate has an x,y,z.  translate(x, y, z);  You may also want to take a look at perspective().

A nice library to consider that can easily set distance is peasycam.
Page Index Toggle Pages: 1