Handling Coordinate System Differences
[ contents ]
Handling Coordinate System Differences

OpenGL and RenderMan Handedness

You can compensate for the differences between OpenGL's right and RenderMan's left-handedness. When doing rotations, you simply negate the angle of therotation.

In the examples below, theta is declared as a float with avalue of 12 degrees. In the following rotate functions, glRotatef() is given thestraight theta, while RiRotate() is given -theta. Beingable to handle gemoetric transformations in this way allows for the sharing ofone set of data between the two interfaces.


Example 1
void display(void){
/*Rotation about the y axis*/

float theta = 0;

/* Figure 1*/
glRotatef(theta, 0, 1, 0);
/* Figure 2*/
RiRotate(theta, 0, 1, 0);
/* Figure 3 sign change*/
RiRotate(-theta, 0, 1, 0);

drawsquare(1.0, cube_flag);

theta = theta + 12;
}

Figure 1
Figure 2
Figure 3

[ example 2 ]