Reference for OCD version 1.4 for use with Processing (BETA) version 125+. If you see any errors or have any comments, let me know.
Name |
Camera |
|
Examples |
import damkjer.ocd.*; Camera camera1; void setup() { size(100, 100, P3D); camera1 = new Camera(this, 200, -250, 300); } void draw() { background(204); lights(); camera1.feed(); } |
|
Description |
Data Type for manipulating the Processing viewport. There are several ways to create a Camera, but all cameras are manipulated the same way. The default camera position sits on the positive z axis. The default target position is at the world origin. The default up direction is in the negative y. The default field-of-view is π / 3 radians. The default aspect ratio is the ratio of the applet width to the applet height. The default near clipping plane is placed a 1/10 x shot length. The default far clipping plane is placed at 10x the shot length. Each constructor provides a way to override these default values. |
|
Fields |
None |
|
Methods |
send what this camera sees to the view port |
|
change the field of view by the specified amount |
||
move the camera and c.o.i. along the side vector by the specified distance |
||
move the camera and c.o.i. along the up vector by the specified distanc |
||
move the camera and c.o.i. along the view vector by the specified distance |
||
arcs the camera over (under) a center of interest at its present azimuth by the specified amount |
||
arcs the camera around a center of interest at its present elevation by the specified amount |
||
instantly change the camera's position to the specified location |
||
instantly change the camera's center of interest to the specified target |
||
rotate the camera about the side vector by the specified amount |
||
rotate the camera about the up vector by the specified amount |
||
rotate the camera about the view vector by the specified amount |
||
tumbles the camera about its center of interest by the specified amounts |
||
moves the c.o.i. around the camera at its present position by the specified amounts |
||
move the camera and c.o.i. simulataneously in the local x-y plane |
||
Constructors |
Camera(parent) Camera(parent, shotLength) Camera(parent, cameraX, cameraY, cameraZ) Camera(parent, cameraX, cameraY, cameraZ, targetX, targetY, targetZ) Camera(parent, cameraX, cameraY, cameraZ, targetX, targetY, targetZ, upX, upY, upZ) Camera(parent, nearClip, farClip) Camera(parent, cameraX, cameraY, cameraZ, nearClip, farClip) Camera(parent, cameraX, cameraY, cameraZ, targetX, targetY, targetZ, nearClip, farClip) Camera(parent, cameraX, cameraY, cameraZ, targetX, targetY, targetZ, upX, upY, upZ, nearClip, farClip) Camera(parent, cameraX, cameraY, cameraZ, targetX, targetY, targetZ, upX, upY, upZ, fov, nearClip, farClip) Camera(parent, fov, aspect, nearClip, farClip) Camera(parent, cameraX, cameraY, cameraZ, fov, aspect, nearClip, farClip) Camera(parent, cameraX, cameraY, cameraZ, targetX, targetY, targetZ, fov, aspect, nearClip, farClip) Camera(parent, cameraX, cameraY, cameraZ, targetX, targetY, targetZ, upX, upY, upZ, fov, aspect, nearClip, farClip) |
|
Parameters |
parent |
PApplet: typically use "this" |
shotLength |
float: distance from the camera to the center of interest |
|
cameraX |
float: x coordinate for the camera position |
|
cameraY |
float: y coordinate for the camera position |
|
cameraZ |
float: z coordinate for the camera position |
|
targetX |
float: x coordinate for the center of interest |
|
targetY |
float: y coordinate for the center of interest |
|
targetZ |
float: z coordinate for the center of interest |
|
upX |
float: x component of the "up" direction vector, usually -1.0, 0.0, or 1.0 |
|
upY |
float: y component of the "up" direction vector, usually -1.0, 0.0, or 1.0 |
|
upZ |
float: z component of the "up" direction vector, usually -1.0, 0.0, or 1.0 |
|
fov |
float: field-of-view angle in vertical direction |
|
aspect |
float: ratio of width to height |
|
nearClip |
float: relative z-position of the near clipping plane |
|
farClip |
float: relative z-position of the far clipping plane |
|
Related |