PDA

View Full Version : Scaling



Abacaxi
06-29-2005, 10:13 PM
I am trying to create a grid and then scale it down.

So far I am just creating the lines parallel to X axis and trying to scale it down to see it.

I changed the angle of it so I can see it, but I would rather change the camera angle.

Thus, my 2 questions are:

a how to scale down the lines I create?
b how to change the camer view?

Here is my code, adn thanks in advance for your response.

void drawAxis void {

glClear GL_COLOR_BUFFER_BIT;
glRotatef 40.0f, 1.0f, 0.0f, 0.0f;
glColor3f 1.0f,1.0f,0.0f;
glBegin GL_LINES;
int i;
for i=-4;i<5;i++{

glVertex3f-4,i/2,0;
glVertex3f4,i/2,0;

}
glEnd;
glFlush;

}

void renderScene void {
glClearColor 1.0f, 1.f, 1.0f, 0.0f; //clear to black
glCleaGL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT;

glLoadIdentity;

glLoadIdentity;
glTranslatef0.0f, 0.0f, 1.0f;
glRotatef30.0f, 1.0f, 0.0f,0.0f;
glScalef.01f,.01f,.01f;
drawAxis;

glFlush;

}

06-30-2005, 07:55 AM
Hello .
You can change your camera position with :
gluLookAt(xCameraPosition,yCameraPosition
,zCameraPosition ,xCenterPoint
,yCenterPoint ,zCenterPoint
,xUpVector ,yUpVector ,zUpVector) ;
actually you need position of camera(CameraPositions) and orientation (point that you look at it ,CenterPoint) and finally up of camera.

goodbye with regurds.....