All pastes #474166 Raw Edit

Untitled

public text v1 · immutable
·published 2007-05-06 17:36 UTC
rendered paste body
void draw() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glLoadIdentity();
    
/* Move scene away from camera */
glTranslatef(0.0, 0.0, -7.0);

/* 0 <= x_degrees <= 90 */
glRotatef(x_degrees, 1.0, 0.0, 0.0);

/* 0 <= y_degrees <= 360 */
glRotatef(y_degrees, 0.0, 1.0, 0.0);
    
/* How to calculate parameters for
 * glTranslatef from x_degrees and y_degrees
 * so it seems cube would be
 * moving left/right and forward/backward
 * relative to the camera?
 */
glTranslatef(iXMove, 0.0, iZMove);
	
DrawCube();
}