funny camera thingy...

Started by
4 comments, last by soggie 20 years, 2 months ago
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.
"Darkness cannot drive out darkness, only Light can do that. Hate cannot drive out hate, only Love can do that."
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?
"Darkness cannot drive out darkness, only Light can do that. Hate cannot drive out hate, only Love can do that."
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.
f@dzhttp://festini.device-zero.de
.... try using glPushMatrix(), glPopMatrix()
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.
"Darkness cannot drive out darkness, only Light can do that. Hate cannot drive out hate, only Love can do that."
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)

f@dzhttp://festini.device-zero.de

This topic is closed to new replies.

Advertisement