Jump to content
  • Advertisement
Sign in to follow this  
thedodgeruk

if i have a position of the target model and shooter model, how do i get the matrix

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

i have the shooter model , and the target model.

i have the positions of these models , so i can get the vector between them
and i have the start position.

i want to create a rocket to go from the shooter to the target.

so i use the shooter position for the rocket position , and i have the vecter between the shooter and target , but how do use the vector to make the rocket into the correct matrix, so it is pointing towards the target ??

Share this post


Link to post
Share on other sites
Advertisement
He don't want to know the distance between the two points, he want the matrix of it's projectile at some time between the two targets.

A matrix is formed from position and rotation. You know the position (moving from shooter to target at a certain speed), and the rotation can be determined from the vector facing between the two. There's a way to get the rotation (either in Euler angles or quaternion) from a forward vector.

Share this post


Link to post
Share on other sites
This topic is discussed frequently; try searching the forums for phrases such as 'billboarding', 'align with normal', 'align with vector', 'align model', etc.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!