Archived

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

Homeymoore

in front of the camera

Recommended Posts

i use the camera.cpp from the camera #3 tutorial on GameTutorail.com... and i can't figure out how to have something in front of the screen all the time. i tried many things, the only way i found, i can't use collision detection with. [edited by - Homeymoore on July 16, 2002 6:55:21 PM]

Share this post


Link to post
Share on other sites
objectPosition = camera.view
Then just adjust the height.

------------
aud.vze.com - The Audacious Engine <-- It''s not much, yet. But it''s mine... my own... my preciousssss...
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155

Share this post


Link to post
Share on other sites
At the end of the frame do glLoadIdentity() and draw it as if no camera translations, rotations have taken place. Also clear the depth buffer before you draw it, that way your gun won't stick in to the wall and you don't have to bother with collision detection for your gun.

[edited by - George2 on July 17, 2002 5:00:28 PM]

Share this post


Link to post
Share on other sites
yea, i did that, but i need something different. i want to be able to throw a rock in front of me, but since i rotate the camera i need to now how much it rotated... and how would i find that out?

Share this post


Link to post
Share on other sites
quote:
but i need it to rotate with the camera, like a gun in Doom...

If you put it where the camera is looking, it will always be on screen. If you need it closer, just get a vector from the camera''s position - camera''s view position and interpolate it accordingly.

------------
aud.vze.com - The Audacious Engine <-- It''s not much, yet. But it''s mine... my own... my preciousssss...
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155

Share this post


Link to post
Share on other sites