Sign in to follow this  
gohkgohk

(like Quake 3)How to make the viewing of 3d space by the use of glulookat()?

Recommended Posts

How to make the viewing of 3d space by the use of glulookat()? including the x,y,z axis eye movement and target point movement just like the feeling when u playing quake3. Also How to contol it by using Mouse. P.S.i am writing a program in C++ using win32 application project:) i am a newbie :) can anyone give me some detail to build a 3d world of using opengl (website)? thx very much

Share this post


Link to post
Share on other sites
Heh... if you are a newbie I would recommend learning more about the C++ language first, and learning your way through opengl with a book or nehe. You should also have some knowledge in 3d math.

Share this post


Link to post
Share on other sites
Quote:
Original post by ScottC
Heh... if you are a newbie I would recommend learning more about the C++ language first, and learning your way through opengl with a book or nehe. You should also have some knowledge in 3d math.


i hv learn a bit about C++
just a newbie of opengl
i hv developed how to view right and left by using opengl
just can't view up and down with it
i think it may be the peoblem of upvector in glulookat:)
can anyone help me?

Share this post


Link to post
Share on other sites
Hello,

Here's a quaternion camera class which will help you avoid gimble lock and what not that plagues the XYZ cameras. Quaternion camera's are the way to go. This will show you everything you asked for.

Of course this is just a sample. You will most likely want to build a more advanced camera system and add frustrum culling. This will help you understand the whole camera concept though.

Share this post


Link to post
Share on other sites
Quote:
Here's a quaternion camera class which will help you avoid gimble lock and what not that plagues the XYZ cameras. Quaternion camera's are the way to go. This will show you everything you asked for.
Sometimes the only way to make a common misunderstanding less common is to correct it, or at least clarify the point, whenever you get the opportunity. So even though I've said this before, I'd like to point out that the above statement perpetuates some quaternion 'myths'. Solving gimbal lock has absolutely nothing to do with quaternions. I have a basic camera/object class that I use every day in my demo code. It supports both FPS and full 6dof motion. It doesn't use quaternions (or even matrices, except for uploading to OpenGL), and there is no gimbal lock.

For someone trying to learn about 3d math and rotations in particular, it's important to understand the subtleties, as misunderstandings will lead to further confusion down the road. This is editorializing, but IMHO switching to a quaternion camera because you can't get your matrix/vector/Euler angle/whatever camera to work is a *big* mistake, at least if understanding the subject matter is important to you. This is also IMO - and going out on a bit of a limb - but I also think those sorts of tutorials do something of a disservice in terms of obscuring and confusing the already complicated issue of rotation in 3d. IMO.

Anyway, I just wanted to (respectfully) offer an alternate point of view to the OP. My advice: forget about quats, and write a simple FPS camera using gluLookAt(), glRotate(), or the equivalent method of your choice.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this