Location : ubic/projects/monkey3d
Monkey3D | Screenshots | Editor | Engine | Engine commands | Local stimulation | Remote stimulation | Contact

Engine commands


General informations

Those commands can be typed in the console (press HOME key to open it in remote stimulation or in local free move modes).
Also, those commands can be sent via a TCP/IP connection using the Java modified UTF character encoding. See Remote stimulation.

Commands list

General notes :

  • Syntax : [...] : optional parameter, {...} : parameter type cast, | : or.
  • Parameters as well as their values are case-sensitive
  • Whitespace is considered as the parameter separator, never use whitespaced parameter values (ex : filenames that have whitespaces would cause problems).

General engine related commands

reset

Resets the engine : loads the default scene, clears command queue.
Also resets the camera view to x = 0, y = 0, z = 0, rx(pitch) = 0, ry(yaw) = 0, rz(roll) = 0 and sets orbit mode to off.

clear

Replaces the current scene with the default scene (empty with just some default materials and lights, same as when creating a new scene in the editor).
Does not reset the engine.

load {string_filename_relative_to_scenes_path}

Loads a scene XML file and resets the engine.

save {string_filename_relative_to_scenes_path}

Saves the current scene in an XML file.
Warning ! Overwrites any existing file having the given filename.

quit

Brutally quit the engine (same as when ESC is typed), not recommanded remotely !! :)

Camera related commands

move [x [@]{real}] [y [@]{real}] [z [@]{real}] [pitch|rx [@]{real}] [yaw|ry [@]{real}] [roll|rz [@]{real}] [during {integer_millis}]

Moves the camera, give at least one coord.
If during is omitted or is = 0, the camera "jumps" at the given coord.
The camera works like a state machine. For each omitted coord, the current value is kept (0 by default).
Given coord values are absolute world destination coords unless you preceed them with '@', then the given value is added to the current value of the corresponding coord.
Rotating over rx is pitch (look up/down), over ry is yaw(look right/left), over rz is roll (roll right/left).
The movement is linearly interpolated such that the camera arrives at position at the command start plus the given interval. Thus, the speed in milliseconds of the movement for a given position/rotation is the difference between the current position/rotation and the given one divided by the during parameter, the speed is distinctly calculated for each direction/rotation.
Example :

move x 0 ry 0
move x 5 ry 90 during 1000

The camera moves to x = 5 at 5 units/second and rotates to ry = 90 at 90 degrees/second.

In remote stimulation, this function is blocking according to the during statement, the system will not listen to any further command (and block the client) until it finishes, if during is set.
When the command is typed in the console and a during statement is >0, further typed commands are queued until it finishes, and so on.


Pitch yaw & roll illustration

orbit on|off

Put the camera in orbit mode (on) or in free fly mode (off).
When the camera is in orbit mode, view rotations are made relative to the world orgin. The camera is always in free fly mode by default. When calling clear or reset or when a scene is loaded, it is also restored to free fly mode.

origin

Resets the camera view to x = 0, y = 0, z = 0, rx(pitch) = 0, ry(yaw) = 0, rz(roll) = 0, does not change the orbit mode state.

Screen related commands

screen on|off

Switch on or off the scene rendering.
The help, debug and console are kept displayed if they are currently displayed.

image {string_filename_relative_to_textures_path} during {integer_millis}

Displays an image.
This function is not blocking, further commands are processed normally.

Scene alteration related commands

add|create {string_element_class} {string_element_id} [to {string_group_id}]

Adds a new element to the scene (optionally to an existing group).
See the editor for the available element classes (ex : cube, sphere, bitPlane, etc...).
You can also use either "create" or "add".
As well as in XML, element classes first letter should be in lowercase, example "Cube" becomes "cube", "BitPlane" becomes "bitPlane". In the editor, the first letter is uppercased only for aesthetic purpose.

remove {string_element_id}

Removes an element from the scene.

set {string_element_id}.{string_attibute_name} {variant_attribute_value}

Alters an element attribute value (ex : visible, material, etc...).
See the advanced element properties in the editor for available attributes.
Matlab specific : When sending set commands via Matlab remote stimulation to create an animation, it is a good idea to put a semicolon ';' at the end of the send() function in order to avoid a standard output printing that slows the animation

Projection related commands

fov {real}

Changes the FOV (Field Of View).
Value must be >0 and <180.
Usually, you would use a FOV value between 40 and 60.

near {real}

Changes the near clipping plane distance.
Value must be >0.

far {real}

Changes the far clipping plane distance.
Value must be >0.

foclen {real}

Changes the focal length.
Value must be >0.

eyesep {real}

Changes the stereo eye separation.
Value must be >=0.
Has only effects when in classic stereo projection mode.

stereomag {real}

Changes the stereo magnitude.
Value must be >=0 and <=2.
close to 0 means no stereo effect, close to 1 means medium stereo effect, close to 2 means high stereo effect.
Has only effects when in constrained stereo projection mode.

parbal {real}

Changes the stereo parallax balance.
Value must be >=0 and <=2.
close to 0 pushes the scene into negative parallax (front of the screen), close to 1 means normal parallax, close to 2 pushes the scene into positive parallax (behind the screen).
You may notice the effect or not depending on the focal length and the near clipping plane distance.
Has only effects when in constrained stereo projection mode.

Appearance related commands

polygon fill|line|point

Changes the polygon rasterization method.
Usually, you would prefer the fill(ed) one.

shading smooth|flat

Changes the shading model.
Usually you would prefer the smooth(ed) one.

antialiasing on|off

Activates or deactivates antialiasing (line and point smoothing).
Only applicable if polygon mode is point or line.