kaleidoscope

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

 

 >  ABOUT  |  FAQ  |  EXAMPLES  |  DOWNLOAD  |  REFERENCE

 

 >  HOME

  How do I get it to work?

It's very easy. After installing the library include the code:


import kaleidoscope.*;

Camera cam;

to the top of your code in setup(). After size(), add:


cam = new AppCamera( this );

This creates a new First Person Shooter (FPS) style camera using the 'W', 'A', 'S', and 'D' keys for movement and the mouse for looking.

  Can I make different types of cameras?

Yes, Kaleidoscope defaults to FPS style, but you can declare a camera that orbits around a center point in a style similar to Maya, Rhino, formZ, etc. Simply add "MAYA" to your assignment (be sure to include the quotes) . IE:

cam = AppCamera( this, "MAYA" );

Drag the left mouse button to rotate, drag the right mouse button to pan. Use the scroll wheel to zoom in and out. (If you do not have a scroll wheel, hold down Shift and drag up and down to zoom).

  It spins out of control when I use it (or it moves too slow)

Getting adjusted to the sensitivity can be tricky if you've never used this style of camera before. You can adjust the sensitivity with:

cam.setRotateSpeed( newrotatespeed );

Keep in mind that the default is 4.0.

You can change the move speed with:

cam.setMoveSpeed( newmovespeed );   // Default: 0.75

If you're using MAYA style, you can use

cam.setTranslateSpeed( newtranslatespeed );   // Default: 20.0
cam.setZoomSpeed( newzoomspeed );   // Default: 2.0


as well.

  Can I adjust the controls of the camera?

Yes, for a FPS style camera use the remap functions. Input any key you want in char form ( 'single quotes' ):

cam.remapForward( 'i' );   // Default: 'w'

cam.remapBackwards( 'k' );   // Default: 's'

cam.remapLeft( 'j' );   // Default: 'a'

cam.remapRight( 'l' );   // Default: 'd'


I will add inverse mouselook soon.

The most you can modify the Maya style camera is to change the center of rotation. Do this with the setCenterOfRotation() function:

cam.setCenterOfRotation( Vec3D( 53.6, 4303.4, -2.0 );// Default (0, 0, 0)

  What is a Vec3D / toxi?

A very useful vector 3D library. It's explained in the download section.

  What is the difference between an AppCamera and a WebCamera?

Due to limitations with Processing / Java, the java.awt.robot class cannot export to applets successfully. This handy tool allows the cursor to always stay in the center of your application window, and provides a MUCH better experience with the camera. I added the WebCamera to allow interesting 3D apps written with kaleidoscope to export to the web. Keep in mind however that you have very little heap space and OPENGL doesn't work on the web either. Both of these tend to be crucial to 3D applications of any sort.

  I cant export an application with AppCamera or WebCamera

Try including all of the libraries used in the examples. These include:

import kaleidoscope.*;
import toxi.geom.Vec3D;
import toxi.geom.Ray3D;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.AWTException;
import java.awt.Point;

It should then export fine.