libmove3d  3.13.0
Functions
Graphic

Functions

void g3d_draw_text (char *string)
void g3d_set_color_vect (int color, GLdouble color_vect[4])
void g3d_get_color_vect (int color, GLdouble color_vect[4])
void g3d_set_color (int color, double color_vect[4])
void g3d_set_custom_color_draw (p3d_rob *r, int draw_custom)
void g3d_set_custom_color_vect (GLdouble color_vect[4])
void g3d_get_custom_color_vect (GLdouble color_vect[4])
void g3d_drawDisc (double x, double y, double z, float r, int color, GLdouble color_vect[4])
void g3d_drawSphere (double x, double y, double z, float r)
void g3d_drawColorSphere (double x, double y, double z, float r, int color, GLdouble color_vect[4])
void g3d_drawCircle (double x, double y, double r, int color, double *color_vect, double width)
void g3d_drawOneLine (double x1, double y1, double z1, double x2, double y2, double z2, int color, double *color_vect)
void g3d_drawSphMoveObj (p3d_matrix4 mat, double length)
void g3d_drawRepMoveObj (p3d_matrix4 frame, double length, int axis)
void g3d_draw_arrow (p3d_vector3 p1, p3d_vector3 p2, double red, double green, double blue)
void g3d_draw_solid_cone (double radius, double height, int nbSegments)
void g3d_draw_rep_obj (p3d_jnt *jnt, double a, int num)
void g3d_draw_simple_box (double x1, double x2, double y1, double y2, double z1, double z2, int color, int fill, double width)
void g3d_draw_a_box (double x1, double x2, double y1, double y2, double z1, double z2, int c, int fill)
int BoxInFrustum_obj (p3d_obj *o, G3D_Window *win)
int SphereInFrustum (G3D_Window *win, float x, float y, float z, float radius)
void g3d_extract_frustum (G3D_Window *win)
int g3d_calcule_resolution (G3D_Window *win, p3d_poly *p)
void g3d_draw_primitive (G3D_Window *win, p3d_poly *p, int fill, int opengl_context)
void g3d_draw_poly (p3d_poly *p, G3D_Window *win, int coll, int fill, int opengl_context)
void g3d_draw_poly_with_color (p3d_poly *p, G3D_Window *win, int coll, int fill, double color, int opengl_context)
void g3d_draw_frame (p3d_matrix4 frame, double length)
int g3d_draw_cylinder (p3d_vector3 p1, p3d_vector3 p2, double radius, unsigned int nbSegments)
void g3d_rgb_from_int (int i, double color[4])
void g3d_rgb_from_hue (double hue, double color[4])
int g3d_draw_robot_joints (p3d_rob *robot, double size)
int g3d_draw_robot_kinematic_chain (p3d_rob *robot)
int g3d_draw_p3d_polyhedre (p3d_polyhedre *polyhedron)
int g3d_circle_table (double **sint, double **cost, const int n)
void g3d_draw_solid_sphere (double radius, int nbSegments)
void g3d_draw_solid_sphere (double x_, double y_, double z_, double radius, int nbSegments)
void g3d_draw_solid_cylinder (double radius, double length, int nbSegments)
void g3d_draw_solid_cylinder (double x_, double y_, double radius, double length, int nbSegments)
int g3d_draw_body_normals (p3d_obj *obj, double length)
int g3d_draw_robot_normals (p3d_rob *robot, double length)
int g3d_draw_body_vertex_normals (p3d_obj *obj, double length)
int g3d_draw_robot_vertex_normals (p3d_rob *robot, double length)
int g3d_is_poly_transparent (p3d_poly *p)
void g3d_draw_ellipsoid (double a, double b, double c, int nbSegments)
void g3d_draw_wire_ellipsoid (double a, double b, double c)
void g3d_draw_floor (GLdouble color[3], int tiles)
void g3d_draw_wall (int wall, GLdouble color[3], int quadsPerEdge)
void g3d_draw_env (int opengl_context)
void g3d_draw (int opengl_context)
void g3d_set_light (g3d_states &vs)
void g3d_init_OpenGL ()
void g3d_set_projection_matrix (g3d_projection_mode mode)
int g3d_export_OpenGL_display (char *filename)
void g3d_set_dim_light ()
void g3d_set_default_material ()
void g3d_set_shade_material ()
void g3d_draw_frame (void)
int g3d_set_camera_parameters_from_frame (p3d_matrix4 frame, g3d_states &vs)
int g3d_save_state (g3d_win *win, g3d_states *st)
int g3d_load_state (g3d_win *win, g3d_states *st)

Detailed Description

The graphic module contains display functions, mainly based upon OpenGL functions.


Function Documentation

int g3d_calcule_resolution ( G3D_Window win,
p3d_poly p 
)

Does not seem to work anymore.

pour appeler la liste opengl de resolution BASSE

pour appeler la liste opengl de resolution MOYENNE

pour appeler la liste opengl de resolution HAUTE

int g3d_circle_table ( double **  sint,
double **  cost,
const int  n 
)

Computes the coordinates of the points of a unit radius circle discretized in n points. sint et cost each have |n+1| elements. Memory is allocated inside the function and must consequently be freed outside the function. The signe of n defines in which direction the circle is travelled around.

void g3d_draw ( int  opengl_context)

This function is the main display function called each time an OpenGL window is refreshed. KEEP ONLY WHAT IS NECESSARY INSIDE IT!!: DEFINE YOUR OWN win->fct_draw2() AND PUT YOUR ADDITIONAL DISPLAY INSIDE. OR USE g3d_draw_env() or g3d_draw_env_custom() defined just before this function.

void g3d_draw_a_box ( double  x1,
double  x2,
double  y1,
double  y2,
double  z1,
double  z2,
int  c,
int  fill 
)

Fonction tracant une boite en couleur donnee

void g3d_draw_arrow ( p3d_vector3  p1,
p3d_vector3  p2,
double  red,
double  green,
double  blue 
)

Draws a 3D arrow.

Parameters:
p1arrow's starting point
p2arrow's ending point
redred component of the arrow's color
greengreen component of the arrow's color
blueblue component of the arrow's color
int g3d_draw_body_normals ( p3d_obj obj,
double  length 
)

Draws the face normals of a body. Each normal is drawn starting from the face center.

Parameters:
objpointer to the body
lengthlength of the displayed normals
Returns:
1 in case of success, 0 otherwise
int g3d_draw_body_vertex_normals ( p3d_obj obj,
double  length 
)

Draws the vertex normals of a body.

Parameters:
objpointer to the body
lengthlength of the displayed normals
Returns:
1 in case of success, 0 otherwise
int g3d_draw_cylinder ( p3d_vector3  p1,
p3d_vector3  p2,
double  radius,
unsigned int  nbSegments 
)

Draws a cylinder from its two face centers.

Parameters:
p1center of the first face (disc) of the cylinder
p2center of the second face (disc) of the cylinder
radiuscylinder's radius
nbSegmentsnumber of segments of the cylinder section
Returns:
1 in case of success, 0 otherwise
void g3d_draw_ellipsoid ( double  a,
double  b,
double  c,
int  nbSegments 
)

Draws an ellipsoid.

Parameters:
aradius along X axis
bradius along Y axis
cradius along Z axis
void g3d_draw_floor ( GLdouble  color[3],
int  tiles 
)

Draws the environment floor.

Parameters:
colorthe floor color
tilesboolean to display floor tiles or not
void g3d_draw_frame ( void  )

The original function of Move3D that displays a frame with black flat arrows.

void g3d_draw_frame ( p3d_matrix4  frame,
double  length 
)

Fonction d'affichage d'un repere (matrice 4x4). Les axes sont dessines sur une longueur "length". A utiliser dans une fonction d'affichage OpenGL.

int g3d_draw_p3d_polyhedre ( p3d_polyhedre *  polyhedron)

Draws a p3d_polyhedre.

void g3d_draw_poly ( p3d_poly p,
G3D_Window win,
int  coll,
int  fill,
int  opengl_context 
)

Fonction dessinant un polyhedre plein ou en filaire

IN => p : pointeur sur le polyhedre courant => win : pointeur sur la structure fenetre => coll : => fill : type de rendu a effectuer

void g3d_draw_poly_with_color ( p3d_poly p,
G3D_Window win,
int  coll,
int  fill,
double  color,
int  opengl_context 
)

Fonction dessinant un polyhedre plein ou en filaire avec une couleur

IN => p : pointeur sur le polyhedre courant => win : pointeur sur la structure fenetre => coll : => fill : type de rendu a effectuer

void g3d_draw_primitive ( G3D_Window win,
p3d_poly p,
int  fill,
int  opengl_context 
)

Fonction dessinant un polyhedre dont la forme est consideree comme primitive

IN => p : pointeur sur le polyhedre a dessiner => fill : type de dessin a appliquer => win : pointeur sur la structure fenetre

0:MED 1:LO 2:HI

int g3d_draw_robot_joints ( p3d_rob robot,
double  size 
)

Draws the joint frames of a robot.

Parameters:
robotpointer to the robot
sizelength of the frame arrows that will be drawn.
Returns:
1 in case of success, 0 otherwise
int g3d_draw_robot_kinematic_chain ( p3d_rob robot)

Draws the kinematic chain of a robot (draw the links between successive joints).

Parameters:
robotpointer to the robot
Returns:
1 in case of success, 0 otherwise
int g3d_draw_robot_normals ( p3d_rob robot,
double  length 
)

Draws the normals of all the robot bodies.

int g3d_draw_robot_vertex_normals ( p3d_rob robot,
double  length 
)

Draws the vertex normals of all the robot bodies.

void g3d_draw_simple_box ( double  x1,
double  x2,
double  y1,
double  y2,
double  z1,
double  z2,
int  color,
int  fill,
double  width 
)

Fonction tracant une boite en couleur donnee

void g3d_draw_solid_cone ( double  radius,
double  height,
int  nbSegments 
)

Cette fonction dessine un cone solide -dont les facettes sont remplies- d'axe z et dont la pointe est en (0,0,0). A utiliser dans une fonction d'affichage OpenGL.

void g3d_draw_solid_cylinder ( double  radius,
double  length,
int  nbSegments 
)

Draws a cylinder, centered on (0,0,0) and aligned along z-axis.

Parameters:
radiuscylinder radius
lengthcylinder length
nbSegmentsnumber of segments of the discretization of the cylinder's section
void g3d_draw_solid_cylinder ( double  x_,
double  y_,
double  radius,
double  length,
int  nbSegments 
)

Draws a cylinder and aligned along z-axis.

Parameters:
xx coordinate of the sphere cylinder
yy coordinate of the sphere cylinder
radiuscylinder radius
lengthcylinder length
nbSegmentsnumber of segments of the discretization of the cylinder's section
void g3d_draw_solid_sphere ( double  radius,
int  nbSegments 
)

Draws a sphere with OpenGL functions. The sphere is centered on (0,0,0).

Parameters:
radiusradius of the sphere
nbSegmentsnumber of segments of the discretization of the sphere silhouette
void g3d_draw_solid_sphere ( double  x_,
double  y_,
double  z_,
double  radius,
int  nbSegments 
)

Draws a sphere with OpenGL functions.

Parameters:
xx coordinate of the sphere center
yy coordinate of the sphere center
zz coordinate of the sphere center
radiusradius of the sphere
nbSegmentsnumber of segments of the discretization of the sphere silhouette
void g3d_draw_text ( char *  string)

Get the current display size and displays the text in the right/bottom corner

Parameters:
stringcontains a string to draw
void g3d_draw_wall ( int  wall,
GLdouble  color[3],
int  quadsPerEdge 
)

Draws one of the environnment box walls.

Parameters:
wallchoice of the wall to display (wall=1,2,3 ou 4).
colorwall color
quadsPerEdgediscretization step of the wall surface (The biggest it is, the nicest is the rendering but the more computationly expensive.)
void g3d_draw_wire_ellipsoid ( double  a,
double  b,
double  c 
)

Draws a wireframe ellipsoid.

Parameters:
aradius along X axis
bradius along Y axis
cradius along Z axis
void g3d_drawColorSphere ( double  x,
double  y,
double  z,
float  r,
int  color,
GLdouble  color_vect[4] 
)

Draws a sphere with the specified color.

void g3d_drawRepMoveObj ( p3d_matrix4  frame,
double  length,
int  axis 
)
Parameters:
framethe Rep position and orientation
lengththe lenght of each arrow
axisthe axis to draw : for x = 1 for y = 2 for z = 4. To draw two axis, add their Id
void g3d_drawSphere ( double  x,
double  y,
double  z,
float  r 
)

Draws a sphere without changing the current color.

int g3d_export_OpenGL_display ( char *  filename)

Saves the current OpenGL pixel buffer as a ppm (PortablePixMap) image file (uncompressed format). In other words: takes a screenshot of the current active OpenGL window.

Parameters:
filenamename of the image file where to save the pixel buffer
Returns:
1 in case of success, 0,otherwise
void g3d_get_color_vect ( int  color,
GLdouble  color_vect[4] 
)

Fills a array with the RGBA coordinates of the specified color index.

Parameters:
colorcolor index (see the #define in include/p3d_type.h)
color_vectthe vector that will be filled with RGBA components
void g3d_get_custom_color_vect ( GLdouble  color_vect[4])

Stores one color to be called latter to draw a robot for example

Parameters:
color_vectthe vector that will be filled with RGBA components
void g3d_init_OpenGL ( )

Initializes OpenGL main parameters.

on desactive tout mode OpenGL inutile

int g3d_is_poly_transparent ( p3d_poly p)

Tests wether or not a p3d_poly is transparent.

Returns:
1 if it is transparent, 0 otherwise
int g3d_load_state ( g3d_win win,
g3d_states st 
)

Loads the viewer state of a given window This function DOES NOT load all the contents of the state. It's created for a specific use.

Parameters:
winwindows
stviewer state
Returns:
1 in case of success, 0 means failure
void g3d_rgb_from_hue ( double  hue,
double  color[4] 
)

Computes an RGB color from a hue value. If the hue parameter varies from 0 to 1, the color will vary from red -> green -> cyan -> blue -> magenta -> red with all intermediate hues.

Parameters:
huehue value (must be between 0 and 1)
coloran array that will be filled with the RGB values corresponding to the given hue. The fourth element is set to 1
void g3d_rgb_from_int ( int  i,
double  color[4] 
)

Returns an RGB color (among a set of predefined colors) from an int. e.g. it can be used to select different colors according to the value of a counter.

Parameters:
ian integer value
coloran array that will be filled with the RGB values corresponding to the given hue. The fourth element is set to 1
int g3d_save_state ( g3d_win win,
g3d_states st 
)

Saves the viewer state of a given window This function DOES NOT save all the contents of the state. It's created for a specific use.

Parameters:
winwindows
stviewer state
Returns:
1 in case of success, 0 means failure
int g3d_set_camera_parameters_from_frame ( p3d_matrix4  frame,
g3d_states vs 
)

Sets the camera parameters (focus point position, zoom factor, elevation and azimuth angles) from a frame matrix. The camera will look in the direction of the X axis of the frame, with the Z axis pointing to the left and the Y axis pointg downward. This function is based on the conventions used in calc_cam_param and get_pos_cam_matrix.

Parameters:
framedesired pose of the camera.
vscamera parameters output
Returns:
0 in case of success, 1 otherwise
void g3d_set_color ( int  color,
double  color_vect[4] 
)

This function does the same thing than g3d_set_color_vect().

void g3d_set_color_vect ( int  color,
GLdouble  color_vect[4] 
)

Sets the current OpenGL color from a color index or an RGBA vector.

Parameters:
colorcolor index (see the #define in include/p3d_type.h)
color_vecta vector of RGBA components (used only if color==Any)
void g3d_set_custom_color_draw ( p3d_rob r,
int  draw_custom 
)

Stores one color to be called latter to draw a robot for example

Parameters:
draw_customTRUE or FALSE
void g3d_set_custom_color_vect ( GLdouble  color_vect[4])

Stores one color to be called latter to draw a robot for example

Parameters:
color_vectthe vector that will be filled with RGBA components
void g3d_set_default_material ( )

Sets the default material parameters for OpenGL.

void g3d_set_dim_light ( )

Sets the light parameters for things that will be displayed in the shadow.

void g3d_set_light ( g3d_states vs)

Sets the default light parameters.

void g3d_set_projection_matrix ( g3d_projection_mode  mode)

Sets the OpenGL projection matrix used by default by the g3d_windows. Use this function instead of calling directly gluPerspective (unlesss you want some specific parameters) to avoid dispersion of the same setting code.

Parameters:
modeprojection mode (perspective or orthographic)
void g3d_set_shade_material ( )

Set the material parameters for things that are in the shadow (floor or wall part) for OpenGL.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines