Jump to content
  • Advertisement

Archived

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

Candy

Any vector movement system tutorials?

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

Hello everyone, I have wrote some codes to make my model walk in a 3D world. However, I think it is too simply and it may incorrect. So I want to know is there any tutorials about a vector movement system? Such as one teaches about how a model walk in a 3D world by using the vector mathematics or how to calculate which direction the model is facing in the world. Thank you very much.

Share this post


Link to post
Share on other sites
Advertisement
Just a quick note...
Depending on what kind of world and how complex it is, you could use a heading variable.
Assign a single point of your world (X=0,Y=0,Z=0) so that it is a heading point. (so you know where it is)
Initialise a variable to zero maybe called "heading".
whenever you turn left it will decrease the heading variable and when you turn right it will increase the heading variable.... think of it as a circle.
** make sure you start by looking at the point of heading **

I doubt this will work well on it''s own if your game area has vertical movement in it though..

if (heading > 360.0)
{
heading -= 360.0
/* so that if you have done a full turn it goes back to zero, plus the extra turn you may have made.... not very clear, but I''m not a teacher.... just a somebody with an idea.
/*
}


well, just a ''quick'' note ....... kinda.... hope it helps

I am a fish...... I am out of the water .... Damn

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!