|
help with path functions :/
#402476
06/06/12 05:53
06/06/12 05:53
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
hi there For my titelmenü, i worked with WED during the last weeks - the first time i use WED since i own an Acknex Engine ^_^" Now i got a problem... i created a few paths with different counts of nodes. All paths are just a line, not a closed circle. When i want to move my camera smoothly with speed reduction to the last node of a path, i looked into path_spline. This works so far - but with just a small Problem: The camera turns around at the Paths last node/start node, and flys back to the beginning ._. Someone told me that i need to do the path movement by my own when using paths that are no closed circles. But i've not really a clue how to move the camera along a path with the same speed and smooth effect as path_spline did ._. can someone help me out here?
Last edited by Espér; 06/06/12 06:54.
|
|
|
Re: help with path functions :/
[Re: Espér]
#402581
06/07/12 11:02
06/07/12 11:02
|
Joined: Jan 2007
Posts: 2,247 Deutsch Niedersachsen
Puppeteer
Expert
|
Expert
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
|
not really, cause my paths have more than 8 waypoints ^_^" Dude Oo You should really be capable of changing this code to work with any amount of nodes for it is as hard to do as lifting a feather =P If you do not like this code you should look into splines. They are easy to implement and work really well. -> Wikipedia. You can calc it pretty much like that:
fs[0]=2.0*time_*time_*time_-3.0*time_*time_+1.0;
fs[1]=time_*time_*time_-2.0*time_*time_+time_;
fs[2]=-2.0*time_*time_*time_+3.0*time_*time_;
fs[3]=time_*time_*time_-time_*time_;
temp_v.x=(fs[0]*spline.start.x+fs[1]*spline.start_tangent.x+fs[2]*spline.end.x+fs[3]*spline.end_tangent.x);
temp_v.y=(fs[0]*spline.start.y+fs[1]*spline.start_tangent.y+fs[2]*spline.end.y+fs[3]*spline.end_tangent.y);
|
|
|
|