22C:161 Introduction to Robotics Spring 1995
Description of interface functions for the CS161 graphics library
These are the main functions of the robotics graphics package (please see
example.c for sample code):
To open a graphics window for simulation:
int OpenGraphicsWindow(double red, double green, double blue);
-- red, green and blue (in range [0..1] define color of the background
-- returns TRUE if the window was opened, FALSE otherwise.
To open a Motif window that gives you slider control:
void OpenMotifWindow(int argc, char **argv);
-- argc and argv are the input parameters to the main() function.
To make a link that gets drawn on the screen:
Geometry3DX NewCuboid(double xdim, double ydim, double zdim,
double xorg, double yorg, double zorg,
double red, double green, double blue,
char *name, DrawStyle3DX renderstyle);
-- xdim, ydim and zdim specify the size of the cuboid.
-- xorg, yorg and zorg specify the global position where the center
of the cuboid is to be placed.
-- red, green and blue (in range [0..1]) specify the color of the cuboid.
-- renderstyle is one of { Off, Wireframe, Solid }
-- name is a char string that gives the cuboid a name.
To make a new coordinate frame (triad):
Triad3DX NewCoordFrame(double red, double green, double blue,
char *name);
-- red, green and blue (in range [0..1]) specify the color of the triad.
-- name is a char string that gives the triad a name.
To draw the current set of cuboid and coordinate frames (triads):
void DrawMotifandGraphics(void);
To set the transformation matrix on a link:
void SetGeometryXfrm(Geometry3DX link, Matrix4D m);
-- link is on object returned by NewCuboid.
-- m is a 4x4 double array that contains the transformation you want.
To set the transformation matrix on a coordinate frame (triad):
void SetTriadXfrm(Triad3DX triad, Matrix4D m);
-- triad is on object returned by NewCoordFrame.
-- m is a 4x4 double array that contains the transformation you want.