perspective()
Lights Camera / CameraDescription
Sets a perspective projection. Simulates natural foreshortening. No args sets default.
Syntax
void perspective()
void perspective(float fov, float aspect, float zNear, float zFar)
Parameters
| Name | Type | Description |
|---|---|---|
| fov | float | field of view angle in radians |
| aspect | float | width/height ratio |
| zNear | float | near clipping plane |
| zFar | float | far clipping plane |
Returns
voidRelated
Under the Hood
From Processing.h:
void perspective();
void perspective(float fov, float aspect, float zNear, float zFar);
Under the Hood
From Processing.cpp:
void PApplet::perspective(){
applyDefaultCamera();
}
void PApplet::perspective(float fov, float aspect, float zNear, float zFar) {
glMatrixMode(GL_PROJECTION); glLoadIdentity();
glScalef(1,-1,1);
_gluPerspective(degrees(fov), aspect, zNear, zFar);
applyStandardModelview();
}