kaleidoscope

a 3D First Person Shooter/Maya style camera for Processing
 
 

 

 >  ABOUT  |  FAQ  |  EXAMPLES  |  DOWNLOAD  |  REFERENCE

 

 >  HOME  |  javadocs

 

Cameras

 
AppCamera( this );
AppCamera( this, "MAYA" );

Creates an instance of the kaleidoscope camera for your applications or sketches

WebCamera(this );
WebCamera( this, "MAYA" );

Creates an instance of the kaleidoscope camera for your web applets. With it, the mouse may drift off the screen

Interface

 
setMoveSpeed( newSpeed );

Set the move speed of the camera (how fast you move forward, back, left and right) with this function.

setRotateSpeed( newSpeed );

Set the rotate speed of the camera (how fast you look around).

setTranslateSpeed(newSpeed);

Set the translate speed of the camera (how you pan around in MAYA mode).

setZoomSpeed( newSpeed );

Set the zoom speed of the camera (how fast you zoom in and out in MAYA mode).

remapForward( char );

Changes the key that moves you forward. Default is 'w'. Be sure the char is lowercase.

remapBackwards( char );

Changes the key that moves you forward. Default is 's'. Be sure the char is lowercase.

remapLeft( char );

Changes the key that moves you forward. Default is 'a'. Be sure the char is lowercase.

remapRight( char );

Changes the key that moves you forward. Default is 'd'. Be sure the char is lowercase.

remapEscape( char );

Changes the key that give you back cursor control. Default is SPACE.

Control

 
setPosition( X, Y, Z );
setPosition( myVec3D );

Sets the position of the camera

getPosition();

Returns a Vec3D of the camera's current position.

setRotation( X, Y, Z );
setRotation( myVec3D );

This allows you to set how far the camera is rotated up (looking up), and how much the camera is rotated horizontally (looking left and right). The vector input should be in degrees.

getRotation();

Returns a Vec3D of the camera's current rotation. Units are in degrees.

setTarget( X, Y, Z );
setTarget( myVec3D );

Sets the target vector of the camera. NOTE: this is not the direction the camera is looking at, rather it is the direction, normalized, added to the position. You can think of it as a small ball fixed floating in front of your eyes.

getTarget();

Returns a Vec3D of the camera's current target. Target is normalized.

setLook( X, Y, Z );
setLook( myVec3D );

Rotates the camera to look in the direction of the vector.

lookAtPoint( X, Y, Z );
lookAtPoint( myVec3D );

Rotates the camera to look at a point in 3D space.

getLook();

Returns a Vec3D of the direction the camera is currently looking.

setUpVector( X, Y, Z );
setUpVector( myVec3D );

Changes the up vector of the camera. Most people will never need to change this.

getUpVector();

Returns a Vec3D of the up vector of the camera, by default it is (0.0, 1.0, 0.0).

setPerspective( fieldOfView,
                aspectRatio,
                nearClip,
                farClip );

Sets the perspective of the scene.

setCenterOfRotation(myVec3D);

Sets the point that the MAYA style camera rotates around and zooms towards. more...

setMaxVerticalAngle(angle);

Sets the maximum amount you can look up or down. By default it is set to 89 degrees.

Actions

 
lookUp( degrees );

Makes the camera look up by a certain number of degrees.

lookDown( degrees );

Makes the camera look down by a certain number of degrees.

lookLeft( degrees );

Makes the camera look left by a certain number of degrees.

lookRight( degrees );

Makes the camera look right by a certain number of degrees.

moveForward( amount );

Moves the camera in the direction you are facing by the amount specified.

moveBackwards( amount );

Moves the camera in the opposite direction you are facing by the amount specified.

moveLeft( amount );

Move the camera laterally left (sidestep left) by the amount specified.

moveRight( amount );

Move the camera laterally right (sidestep right) by the amount specified.

moveUp( amount );

Moves the camera along an axis that would stretch from your feet through your head. Note that the axis changes as you tilt foward (look down). This movement is not possible under traditional FPS control.

moveDown( amount );

Moves the camera along an axis that would stretch from your feet through your head. Note that the axis changes as you tilt backwards (look up). This movement is not possible under traditional FPS control.

Utilities

 
begin2D();

When this is called you can draw directly onto the screen like a normal Processing sketch. more...

end2D();

Everything called after this statement will appear in 3D space. 2D objects are placed at (X, Y, 0). more...

getMouseProjection(float arm);

Gets the point that is the specified distance away from the camera, in the direction of your cursor. Imagine the cursor is your arm, and the point is your hand.

GImage

 
GImage face =
  new GImage( cam );

  new GImage( cam, myImage );

A data type for images in 3D that always face the camera, also called billboards. more...

cam.addImage( PImage );

Adds an image to the drawing queue of the camera.

cam.renderAll( );

Draws all images in the drawing queue.

setCenterOfRotation()

begin2D()
end2D()

GImage