# The Industry's Foundation for High Performance Graphics

1. ## help me !!!!!

i've created a 3d pyramid using display list. now i want to move camera to watch it in ariel view,such as watching pyramid from helicopter. what should i do ?. is it simple rotation using glRotatef()

2. ## Re: help me !!!!!

if you just want to get a top view, just rotate your pyramid 90 degrees on the x axis

(degree, x, y, z)
glRotatef(90,1,0,0);

not sure if -90 or 90, just try it.

Newbie

3. ## Re: help me !!!!!

Hi you to rotate your pyramide !!!!

define a rotate Variable like rot
for example:
static GLfloat rot = 0.0f;

go to your Draw Routine and write
glRotatef(Rotate, 1.0f, 0.0f, 0.0f);
Rot += 1.0f;
and now your object should rotate around the x-axis

I hope that solve your problem

c u

4. ## Re: help me !!!!!

but in that pyramid several cubes are placed, glTranslatef() for each cube. to use glRotatef() what should be the position of glTranslatef.

5. ## Re: help me !!!!!

if you mean you have cubes positioned inside the pyramid and you want the whole thing to rotate, then here is what you do:

glRotatef(rot++,1,0,0);// define rot as GLfloat

//do drawing here

your pyramid and cubes shold all rotate as one object. If you have glLoadIdentity in your drawing process, replace them with glPushMatrix and glPopMatrix like so:

glRotatef(rot++,1,0,0);// define rot as GLfloat
//drawing
glPushMatrix();
//draw pyramid
glPopMatrix();

glPushMatrix;
//draw cubes
glPopMatrix();

lather rinse repeat

6. ## Re: help me !!!!!

actually add a glTranslatef(); in the z direction into where your pyramid is going to appear right before the glRotatef() so that you are rotating the x axis near your pyramid.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•