Results 1 to 2 of 2

Thread: Scaling

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2005
    Posts
    4

    Scaling

    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;

    }

  2. #2
    Guest

    Re: Scaling

    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.....

Similar Threads

  1. Scaling i want to add scaling to my codeould someone advise me how
    By cloudracer in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-27-2014, 02:07 PM
  2. Scaling for a HUD
    By morello in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 06-01-2011, 10:42 AM
  3. Scaling MD3
    By DarkWIng in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 12-11-2001, 09:40 AM
  4. Scaling
    By BarrelRider in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-24-2001, 07:00 AM
  5. scaling
    By fox in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-11-2000, 04:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean