An actor can be represented in many ways. We can have a see the surface or the wireframe of an actor or maybe we are just interested in the bounding box. In Voxelent each actor keeps track of its visualization mode in its mode property.

The setVisualizationMode operation must be used to change the mode property:

var cone = vxl.api.getActor('cone'); //we have an actor named cone in the scene
cone.setVisualizationMode(mode); //sets the visualization mode of the cone to 'mode'

The following are the visualization modes available up to Voxelent version 0.89.4:

 Solid

This is the mode by default in voxelent.

var monkey = vxl.api.getActor('monkey');
monkey.setVisualizationMode(vxl.def.actor.mode.SOLID);

SOLID

SOLID

Solid and Bounding Box

On this mode the actor is displayed along the bounding box that contains the actor. The bounding box is calculated by finding the maximum and minimum coordinates present in the actor model property.

var monkey = vxl.api.getActor('monkey');
monkey.setVisualizationMode(vxl.def.actor.mode.SOLID_AND_BB);

vxl.def.actor.mode.SOLID_AND_BB

vxl.def.actor.mode. SOLID_AND_BB

Bounding Box

Only the bounding box is displayed. This mode is useful to test collisions.

var monkey = vxl.api.getActor('monkey');
monkey.setVisualizationMode(vxl.def.actor.mode.BOUNDING_BOX);

BOUNDING_BOX

vxl.def.actor.mode. BOUNDING_BOX

Flat

The flat shading mode allows to visualize a solid representation of the cells (triangles) that the geometry is made of. This mode is used for cell based picking.

var monkey = vxl.api.getActor('monkey');
monkey.setVisualizationMode(vxl.def.actor.mode.FLAT);

FLAT

vxl.def.actor.mode.FLAT

Lines

This mode uses the gl.LINES mode to draw the elements contained in the geometry (actor.model)

var monkey = vxl.api.getActor('monkey');
monkey.setVisualizationMode(vxl.def.actor.mode.LINES);

LINES

vxl.def.actor.mode.LINES

Points

This mode allows visualizing the different vertices that the geometry is made of.

var monkey = vxl.api.getActor('monkey');
monkey.setVisualizationMode(vxl.def.actor.mode.POINTS);

vxl.def.actor.mode.POINTS

vxl.def.actor.mode.POINTS

Wireframe and Solid

This mode shows a solid rendering of the actor where the wireframe is overlaid.

var monkey = vxl.api.getActor('monkey');
monkey.setVisualizationMode(vxl.def.actor.mode.WIRED_AND_SOLID);

vxl.def.actor.mode.WIRED_AND_SOLID

vxl.def.actor.mode.WIRED_AND_SOLID

Wireframe

Similar to LINES but not quite the same. While LINES will draw a line for each pair of indices contained in the geometry, this mode will create a triangle for each triad of vertices contained in the geometry. The wireframe is shaded by default but the shading can be deactivated using the setShading operation as we saw in the actor tutorial.

var monkey = vxl.api.getActor('monkey');
monkey.setVisualizationMode(vxl.def.actor.mode.WIREFRAME);

vxl.def.actor.mode.WIREFRAME

vxl.def.actor.mode.WIREFRAME