Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

soggie

funny camera thingy...

This topic is 5306 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I''ve just created my camera from the gametutorials tutorial on camera with all the function with mouselook and strafe. Problem is, in my drawing code, i loaded a milkshape mesh (whose drawing code is encapsulated in the model class) and when i loaded the program, the model got stuck to my camera and moved where i moved. Freaky. So here''s what i found - if I placed gluLookAt with generic values (not the values from the camera) in my drawing code instead of in the camera''s Look() code, it works fine. How do I get about it? Thanks in advanced.

Share this post


Link to post
Share on other sites
Advertisement
tried this:

gluLookAt(40, 40, 40, 0, 0, 0, 0, 1, 0);

and it works

gluLookAt(40, 40, 40, camera.view.x, camera.view.y, camera.view.z, camera.up.x, camera.up.y, camera.up.z);

and it works

gluLookAt(camera.pos.x, camera.pos.y, camera.pos.z, camera.view.x, camera.view.y, camera.view.z, camera.up.x, camera.up.y, camera.up.z);

and it DOESNT works!!!!

can anybody please tell me what is happening?

Share this post


Link to post
Share on other sites
the most likely problem? camera does not have position 40,40,40, is not looking at point 0,0,0 or has a bad "up"-vector.

Share this post


Link to post
Share on other sites
kno what guys? it worked perfectly today. Don''t know what I changed and what I did to make it work. Sigh. Also I did not use Push and Pop matrix whatsoever. Maybe its because of a slip up in the camera code? Man I hate it when it works without a reason. Freaky.

Share this post


Link to post
Share on other sites
quote:
Original post by soggie
kno what guys? it worked perfectly today. Don''t know what I changed and what I did to make it work. Sigh. Also I did not use Push and Pop matrix whatsoever. Maybe its because of a slip up in the camera code? Man I hate it when it works without a reason. Freaky.


a more unlikely thing that can sometimes make things work all of a sudden (or not) is your ide. if it doesnt recompile some files (example cpp files including a header you just changed) strange things might happen because whatever you do is simply ignored until its all compiled again (one more reason to not have implementations in header files)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!