VR-Forces 4.2 Class Documentation
11.4 - Objects

You can use the Remote Draw API to draw several types of objects and text in 2D and 3D.

You can specify the parameters of each type of object. Common default parameters are supplied for simplified use. In addition, there are accessors and mutators for each object parameter supported. Every object needs a unique ID. The ID is used to generate the global ID for the object. Each object must also take a pointer to the DtExerciseConn object.

The following example creates and displays a red circle in the center of the window.

int nextId=1;
DtVdcVector2D position( 0.5, 0.5 );
DtVdcVector2D size( 0.2, 0.2 );
DtEllipseObject* circle = new DtEllipseObject( exconn, nextId++, position, size );
circle->setColor( DtVdcColor::DtVdcRed );
circle->update();

To change the color of the circle from red to green, and tell VR-Forces about the change, do the following:

circle->setColor( DtVdcColor::DtVdcGreen );
circle->update();

To remove and destroy the circle object, do this:

delete circle;

[<< Major Classes] [Home] [Top of Page] [2D Objects >>]


Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)