FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   perspective()
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: perspective()  (Read 2804 times)
flight404

WWW Email
perspective()
« on: Jul 25th, 2003, 4:45am »

What are the parameters for perspective()?
 
And if anyone has a few minutes to kill, can someone give me a basic explanation of uses for beginCamera()?
 
Danke.
 
r
 
toxi

WWW
Re: perspective()
« Reply #1 on: Jul 25th, 2003, 10:29am »

hey, the parameters are:
 
perspective(viewAngle,aspectRatio,nearClipZ,farClipZ);
 
viewAngle (FOV) is specified in degrees and must be >0 and <180
 
aspectRatio is calculated by (float)width/height of the window
 
nearClipZ and farClipZ are the clipping distances of the camera, meaning any vertice closer than nearClipZ or further away from the cam than farClipZ are being clipped. however, i don't think clipping is properly implemented in 0056, the typical sign of this are the random lines you see at the moment when an object is too close to the cam. so don't get too frustrated farClipping is more for speed optimization as you usually consider objects behind that "barrier" as too small to be drawn/shown.
« Last Edit: Jul 25th, 2003, 10:36am by toxi »  

http://toxi.co.uk/
arielm

WWW
Re: perspective()
« Reply #2 on: Jul 25th, 2003, 6:19pm »

a great way to learn more about perspective(), lookat() and btw about all the matrix-transform-push-pop plumbery is to read openGL literature since it's the inspiration for all that...
 
e.g. there's the "openGL programming guide, chapter 3: viewing":
http://fly.cc.fer.hr/~unreal/theredbook/chapter03.html
 
recommended! (5 stars on the bglpppl scale)
 

Ariel Malka | www.chronotext.org
Pages: 1 

« Previous topic | Next topic »