Archived

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

Want to make one mesh follow the other?

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

Just make the second mesh follow the same path just always be x amount behind the other. In all of my apps, the position on the path is a function of time, so what I would do would be
[pseudocode]
Mesh1.Position = GetPosFromPath(CurrentTime);
Mesh2.Position = GetPosFromPath(CurrentTime - 10);
[/pseudocode]

Share this post


Link to post
Share on other sites
quote:
Original post by ms291052
Just make the second mesh follow the same path just always be x amount behind the other. In all of my apps, the position on the path is a function of time, so what I would do would be
[pseudocode]
Mesh1.Position = GetPosFromPath(CurrentTime);
Mesh2.Position = GetPosFromPath(CurrentTime - 10);
[/pseudocode]


I''d be interested in hearing more about this? Is this for every entity/actor/whatever or just scripted things?

Do you really store the x(t) function or do you calculate backwards?

Share this post


Link to post
Share on other sites
That would be a good but I''m actually hoping that I''d get help on making the mesh chase the first one cos The first mesh will be later on to move based on keyboard commands you know so traversing a set path won''t do. any ideas

Share this post


Link to post
Share on other sites
The first mesh is your character. As you press keyboard buttons your guy runs. The chaser can simply determine a vector between itself and your character and then use that as your path for a certain time interval.

This spans into the ability to have smarter and dumber AI. Those who calculate chase vectors more often and as such follow your path directly and those that calculate less often meaning they will not (in general) follow the best fitting path. Add in some path variation like weaving and such and you''ll have a nice chasing mechanism.

Webby

Share this post


Link to post
Share on other sites