Archived

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

Tobias

Rendering a weapon...

Recommended Posts

Hi, I just wonder if anyone knows how to render a gun like in QuakeX that always point in the same direction. I looked in the q1source how John did it, but that didn''t make me much wiser... There must be some good way the calculate the angle from the position and the lookat point of the camera... TIA, Tobias

Share this post


Link to post
Share on other sites
If your angle should depend on the distance of the point you look at, you must rotate your weapon about arctan(distance from viewpoint to weapon/distance from viewpoint to lookat point), the rotation axis must be normal to the lookat vector and normal to the vector viewpoint-weapon.

Visit our homepage: www.rarebyte.de.st

GA

Share this post


Link to post
Share on other sites
You mean the little weapon you hold in front of you, right? For that, you dont perform ANY calculations on it (including camera). It should stay directly in front of you the whole time (assuming you defined the points correcly).

--TheGoop

Share this post


Link to post
Share on other sites
quote:
Original post by TheGoop
For that, you dont perform ANY calculations on it (including camera).

CAUTION, view matrix still applies



-kertropp

C:\Projects\rg_clue\ph_opt.c(185) : error C3142: 'PushAll' :bad idea
C:\Projects\rg_clue\ph_opt.c(207) : error C324: 'TryCnt': missing point

Share this post


Link to post
Share on other sites