Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Opengl Camera


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 zd97le   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 February 2000 - 09:38 PM

Hi i want to find a way to make a camera in Opengl. I have used some things but none is working. Also i ve seen how some people use gluLookAt. But i dont know exactly how to make an opengl camera for a 3d engine. Can anyone send some help or hints?Thanx

Sponsor:

#2 Spellbound   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 February 2000 - 10:36 PM

A common way of implementing a camera is this:

struct Camera
{
float Position[3];
float Yaw;
float Pitch;
float Roll;
};

To use this way you have to initialize the MODELVIEW matrix like so:

glTranslate3f(-Position[0], -Position[1], -Position[2]);
glRotatef(-Roll, 0, 0, 1);
glRotatef(-Pitch, 1, 0, 0);
glRotatef(-Yaw, 0, 1, 0);

Another way, which is more suitable for use with gluLookAt:

struct Camera2
{
float Position[3];
float LookAt[3]; // The coordinate that the camera is focusing on
float CameraUp[3]; // The direction of the camera''s upvector in world coordinates
};

With this structure it is, as I mentioned easier to use gluLookAt:

gluLookAt(Position[0],Position[1],Position[2],
LookAt[0],LookAt[1],LookAt[2],
CameraUp[0],CameraUp[1],CameraUp[2]);

(I''m too lazy to write correct C code here, but you get the idea.)

#3 zd97le   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 February 2000 - 12:07 PM

Thanx for your help my friend. If you could give me the split planes algorithm for bsp trees i would be grateful




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS