Classes
NameCamera
DescriptionData 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
60 degrees PI/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.
MethodsCamera Switchingfeed()send what this camera sees to the view port
Perspective changeszoom(amount)change the field of view by the specified amount
Straight-line movementstruck(distance)move the camera and c.o.i. along the side vector by the specified distance
boom(distance)move the camera and c.o.i. along the up vector by the specified distance
dolly(distance)move the camera and c.o.i. along the view vector by the specified distance
Arc movementsarc(amount)arcs the camera over (under) a center of interest at its present azimuth by the specified amount
(which would be preferred here... arc length or change in elevation?)
circle(amount)arcs the camera around a center of interest at its present elevation by the specified amount
(which would be preferred here... arc length or change in azimuth?)
Instantaneous Changesjump(locationX, locationY, locationZ)instantly change the camera's position to the specified location
aim(targetX, targetY, targetZ)instantly change the camera's center of interest to the specified target
RotationsNote: the following three methods assume degrees, but I think I remember seeing an angleMode() somewhere that sets the preferred angular units. Is there any way to check this and use radians or degrees based on the preferred mode? (Everything's in radians now.)
tilt(amount)rotate the camera about the side vector by the specified amount
pan(amount)rotate the camera about the up vector by the specified amount
roll(amount)rotate the camera about the view vector by the specified amount
Combinationstumble(azAmount, elAmount)tumbles the camera about its center of interest by the specified amounts
(which would be preferred here... arc lengths or change in azimuth and elevation?)
look(azAmount, elAmount)moves the c.o.i. around the camera at its present position by the specified amounts
(which would be preferred here... arc lengths or change in azimuth and elevation?)
track(xDistance, yDistance)move the camera and c.o.i. simulataneously in the local x-y plane
ConstructorsCamera(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, 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)
Parametersparent | 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 |