Shooting an enemy
I am trying to implement a First person shooter in OpenGL. I am having trouble figuring out how to locate the position of an object after transformations?
In other words, after the user moves around in the world by hitting the arrow keys how do I figure the new positions of objects in the world?
Thanks in advance.
Vibi
what i did in DX is to have a few variables to keep track of where the user is, so every time the usermoved, it would change the variables (x, y, z, direction) in addition to doing the transformations and then you can just look at these vars to find out where the user is.
for the transforms i had all the meshes at a certian point ( i think at (0,0,0)), and transformed them every frame i accordance to the variable mentioned above every frame. This probably isn''t the ideal way of doing this, but it does work (speed wasn''t really a concern to me, it was just a simple demo i made so i could get used to DX).
hope this helps
for the transforms i had all the meshes at a certian point ( i think at (0,0,0)), and transformed them every frame i accordance to the variable mentioned above every frame. This probably isn''t the ideal way of doing this, but it does work (speed wasn''t really a concern to me, it was just a simple demo i made so i could get used to DX).
hope this helps
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement