Jump to content
  • Advertisement
Sign in to follow this  
TAlchemist

turn orientation

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

ok i am working on a rewrite of the entire movement system for my game right now. all objects have the following <vectors> location forward up right target < location where i want it to be > targetForward < what the forward should be when we get to target > = target - location and then normalized right? currently i just set the forward to target forward and allow it to move in the forward direction till it gets there and it moves pretty good but i want it to turn around slowly and go there not just boom im turned? i played with using D3DXVecLerp < i think that is what it was called > but it made the object < a missile for orientation purposes > bounce back and forth and spin all around.

Share this post


Link to post
Share on other sites
Advertisement
It is a bit unclear what these vectors you are talking about are, are forward up and right the components of one vector or possible the orthogonal origin for a UVN camera system?

Anyways if im understnading you right you have a sequence of targets defining a path that you want an object to follow. How does this target system work, if the targets are all in an array that you access based on the value of a variable in your object (defining what target you are on) it sounds to be like you are forgetting to increment the variable in your obeject and it thinks that its on the same target again. This would explain the bouncing and spinning because of slight floating point misses on the actual target.

This is a wild guess, you havent explainned how ur objects work at all really.

Share this post


Link to post
Share on other sites
no there is only one target for now that can be changed. later a path would just be change target after reaching target with a script, but that is much latter.

there is a forward vector, right vector, and up vector...with a velocity that can applied in any direction along its own axis. And the vectors are orthogonal like the camera system.

I can set the forward to be the target - current location and it moves correct but it just bounces to face the right direction immediately instead of completeing a slow turn then moving.

When ever i click the mouse on the terrain it makes a target and the player should turn around if nessicary and then move to the new target. kinda like how you could move in diablo or in an rts.

oh i tried once to get it to use the D3DX Lerp function to increment from CurrentForward vector to the TargetForward vector then move, but that just caused it to turn a bit then sit still. i need to work on that code.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!