gluLookAt problem

vobla
Unregistered
 
Post: #1
Hy all,

I started learning OpenGL a few days ago, so I'm quite a newbie.
Anyway, I've this little gluLookAt issue: when i press up or down, the screen gets blank (not when I press left or right!).

Starting values (Camera class properties):
Code:
private static float m_EyeX = 0.0f;
private static float m_EyeY = 0.0f;
private static float m_EyeZ = 1.0f;
private static float m_CenterX = 0.0f;
private static float m_CenterY = 0.0f;
private static float m_CenterZ = -1.0f;
private static float m_UpX = 0.0f;
private static float m_UpY = 1.0f;
private static float m_UpZ = 0.0f;

Movement:
Code:
...

switch (keyData)
{
    case Keys.Up :
        m_EyeZ -= maxSpeed;
        m_CenterZ -= maxSpeed;
        break;
                    
    case Keys.Down :
        m_EyeZ += maxSpeed;
        m_CenterZ += maxSpeed;
        break;
            
    case Keys.Left :
        m_EyeX -= maxSpeed;
        m_CenterX -= maxSpeed;
        break;
                    
    case Keys.Right :
        m_EyeX += maxSpeed;
        m_CenterX += maxSpeed;
        break;
}

...

Draw function:
Code:
GL.glLoadIdentity();
GL.gluLookAt(Camera.EyeX, Camera.EyeY, Camera.EyeZ,
             Camera.CenterX, Camera.CenterY, Camera.CenterZ,
         Camera.UpX, Camera.UpY, Camera.UpZ);
//Translation
//Rotations
//Scaling
//Drawing

BTW, when I set m_EyeZ = 100.0f, the screen still gets blank, but I can see some zooming. The thing is the bigger m_EyeZ value is, the further camera is from the object, but screen doesn't get blank so fast while zooming out..

Thanks in advance and sorry if it's obvious..Rolleyes
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL gluLookAt() not doing anything? ene777 1 3,828 May 1, 2008 08:50 AM
Last Post: ThemsAllTook
  gluLookAt vs. glRotatef/glTranslatef...etc hangt5 9 8,474 Mar 15, 2005 12:54 PM
Last Post: OneSadCookie
  Problems with gluLookAt(); ghettotek 6 5,787 Feb 9, 2003 04:35 AM
Last Post: ghettotek