Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  [SOLVED]Camera Can't Look Directly Down?  (Read 529 times)
0 Members and 2 Guests are viewing this topic.
Offline Cakey

Full Member
**

Posts: 127



« on: 2009-04-19 13:51:55 »

 Undecided I just realized that the openGL camera can't look directly downward (the XZ axis).
I understand why, it's because how could OpenGl derive an angle/perspective with say the given commands
1  
2  
       private Point3D Camera = new Point3D(0.0f, 16.0f, 0.0f);
private Point3D CameraLook = new Point3D(0.0f, 00.0f, 0.0f);

Well it couldn't.

How can I work around this?

I don't really need the perspective to change. I guess this is what I get for making 2-D esque games in 3-D.

Things I've tried so far:
1. Offsetting the camera by miniscule ammounts (ex 0.1f, 0, 0), but that creates a shuddering effect and makes my quads all choppy.
2. glOrtho, either I'm not setting the viewport up right or it's not working for some reason?

Offline Cakey

Full Member
**

Posts: 127



« Reply #1 on: 2009-04-19 14:03:45 »

figured it out haha

1  
2  
3  
glu.gluLookAt(Camera.X, Camera.Y, Camera.Z,
            CameraLook.X, CameraLook.Y, CameraLook.Z,
            1,0,0);

^^^^^ The above works.

vvvvvvvv the below was the issue
1  
2  
3  
glu.gluLookAt(Camera.X, Camera.Y, Camera.Z,
            CameraLook.X, CameraLook.Y, CameraLook.Z,
            0,1,0);


Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.06 seconds with 20 queries.