Updated OrthoVSPerspective example

This commit is contained in:
codeanticode
2011-05-28 02:08:16 +00:00
parent a85fad8d08
commit 54d443c669
@@ -27,11 +27,11 @@ void draw()
if(mousePressed) {
float fov = PI/3.0;
float cameraZ = (height/2.0) / tan(PI * fov / 360.0);
float cameraZ = (height/2.0) / tan(fov/2.0);
perspective(fov, float(width)/float(height),
cameraZ/2.0, cameraZ*2.0);
} else {
ortho(-width/2, width/2, -height/2, height/2, -10, 10);
ortho(0, width, 0, height);
}
translate(width/2, height/2, 0);