[help] spline like pathing interpolation code

Blitz3D Forums/Blitz3D Programming/[help] spline like pathing interpolation code

Defoc8(Posted 2008) [#1]
hi..

what im looking for in some sort of smooth 3d spline like pathing..
- a set of path nodes [these may shift during pathing]
- calcs position,facing + must allow for speed variation..object
traveling along path may increase or decrease its speed at any
time.

Even if you dont have any code like this you want share - perhaps a well
commented simpler system would do..

..any help would be appreciated - i would prefer not having to write
this from scratch... but if nothing is availble..er..i guess i will have to :p

thanks in advance :)


Ross C(Posted 2008) [#2]
Stevie G helped me once with a 4 point curve type algo:

http://www.blitzbasic.com/Community/posts.php?topic=76794#859532

Third post down. The algo works a treat for me :o) Hope that helps.


andy_mc(Posted 2008) [#3]
there was a spline demo code sample with blitz3D, it's called birds I think. Can't remember who wrote it but it works very well.


Naughty Alien(Posted 2008) [#4]
..what im doing is simply set path nodes, and then turning smooth entity towards next node when it approach current one for specific distance..simple and working like a charm..


Defoc8(Posted 2008) [#5]
Thanks guys :)
- will check these out :)

Naughty Alien - your method is acceptable in many situations..but too
hard to manage in a time based system - were objects are expected to be
in a certain place at a certain time...


Naughty Alien(Posted 2008) [#6]
method is adoptable to any time frame you want...you may adopt speed at ANY moment simply by using timer/speed attached to any node..practically you do that to pivot and then simply attach camera, or whatever you like to that pivot and enjoy...im using this for my cut scenes and its working brilliant...and no heavy math behind at all, while results are real beauty..


Kryzon(Posted 2008) [#7]
Naughty, why don't you do your cutscenes on an animation workstation like 3DS Max, and then export using the B3D Pipeline, using a dummy? it's much easier than doing it by code.


Naughty Alien(Posted 2008) [#8]
Im using 3dsmax to set up my nodes for cutscenes properly, using levels builted so its all matching..but on the way i said, i simply need less number of nodes and on way i did it things moving smooth, there is no jagged turnings at all, and I can control speed regardless number of nodes while camera is entirely free to look at any position while nicely moving along path..code is not complex at all and its just one function call..