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
perspective() (Read 796 times)
perspective()
Jan 9th, 2009, 2:02pm
 
Shouldn't the fov variable stay as radians and not be re-converted when creating the cameraZ variable?


// Re-creates the default perspective
size(100, 100, P3D);
noFill();
float fov = PI/3.0;
float cameraZ = (height/2.0) / tan(fov);
perspective(fov, float(width)/float(height),
           cameraZ/10.0, cameraZ*10.0);
translate(50, 50, 0);
rotateX(-PI/6);
rotateY(PI/3);
box(45);
Page Index Toggle Pages: 1