Jump to content
  • Advertisement


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


3D Vectors?

This topic is 5758 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

Im using OpenGL to move through a 3D world you can look around ect using a camera. I was wondering I am needing to find a way to add bullet fireing into the program. I was wondering how exactly I would go about finding the correct 3D vectors using the what I have. I have the postion of the user and the angle the user is located at with the camera. Now im simply trying to find how exactly to calculate the correct vector from the user to the direction the user is facing basically. How would you go about doing this? Don''t click me! Killer Eagle Software

Share this post

Link to post
Share on other sites
i find that the easiest way to do it is to have every single object in my openGL world have a view, up & strafe vector as member variables. when i add a bullet:

bullet.pos = shooter.pos;
bullet.view = shooter.view;
bullet.up = shooter.up;
bullet.strafe = shooter.strafe;

bullet.vel = whatever bullet type speed....

done...the bullet is derived from a base Game_Object type, so i just push it onto the object stack and the engine takes care of moving it around..


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!