VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
12.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 Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)