Handling Coordinate System Differences - example 2
[ example 1 ]
Handling Coordinate System Differences - example 2

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 2
void display(void){
/*Rotation about the x axis*/

float theta = 0;

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

drawsquare(1.0, cube_flag);

theta = theta + 12;
}

Figure 1
Figure 2
Figure 3

[ example 3 ]