VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)