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;
}