gluLookAt problem

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):
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;


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


Draw function:
GL.gluLookAt(Camera.EyeX, Camera.EyeY, Camera.EyeZ,
             Camera.CenterX, Camera.CenterY, Camera.CenterZ,
         Camera.UpX, Camera.UpY, Camera.UpZ);

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 5,719 May 1, 2008 08:50 AM
Last Post: ThemsAllTook
  gluLookAt vs. glRotatef/glTranslatef...etc hangt5 9 12,379 Mar 15, 2005 12:54 PM
Last Post: OneSadCookie
  Problems with gluLookAt(); ghettotek 6 7,747 Feb 9, 2003 04:35 AM
Last Post: ghettotek