Results 1 to 2 of 2

Thread: glulookat not working :-(

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2008
    Posts
    20

    glulookat not working :-(

    void GLEngine::turn(float x)
    {
    ewAngle+=x*0.017453292519943295769236907684886;
    eyeVX=-sin(g_ViewAngle);
    eyeVZ=cos(g_ViewAngle);
    lookDir.x=((eyeVX+eye.x)*2);
    lookDir.z=((eyeVZ+eye.z)*2);
    }
    void GLEngine::move(float x)
    {
    eye.x+=eyeVX*x;
    eye.z-=eyeVZ*x;
    lookDir.x+=eyeVX*x;
    lookDir.z-=eyeVZ*x;
    }
    void GLEngine::climb(float x)
    {
    eye.y+=x;
    lookDir.y+=x;
    }
    could someone help me figure out why this code doesn't work???

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: glulookat not working :-(

    >> lookDir.x=((eyeVX+eye.x)*2);
    >> lookDir.z=((eyeVZ+eye.z)*2);

    What's '*2' doing? I dont think it's suppose to be there.

Similar Threads

  1. Replies: 0
    Last Post: 04-27-2018, 08:20 PM
  2. Working with glFrustum and gluLookAt
    By raluk22 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-23-2013, 12:13 PM
  3. Replies: 1
    Last Post: 11-18-2011, 08:13 AM
  4. glulookat not working :-(
    By laeuchli in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 12-29-2000, 08:52 AM
  5. glulookat not working :-(
    By laeuchli in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 12-27-2000, 01:14 PM

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