VR-Forces 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 Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)