spline !?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Ghus
Posts: 13
Joined: Wed May 12, 2010 5:42 pm

spline !?

Post by Ghus »

i have an array of positions and rotations of an object

how can i make the object to follow a path like in the spline but i need the rotation also

i have searched the forum but didn't find what i need

could somebody give me a tip :oops:
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Re: spline !?

Post by Acki »

Ghus wrote:could somebody give me a tip :oops:
of course: "don't eat yellow snow !!!" :lol:

but seriously, I think you should code it on your own...
it should not be too hard tho... ;)
move the node from point A to point B...
for the rotation point A is the starting angle and point B the destination angle, so you can calculate the rotation for each point of the line easily... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Mag-got
Posts: 42
Joined: Tue Dec 04, 2007 5:53 pm

Post by Mag-got »

of course: "don't eat yellow snow !!!"
:lol: Fine tip.

*cough*cough*vector3df::getInterpolated(vector3d<T> &other, f64 d)*cough*cough*
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Mag-got wrote:vector3df::getInterpolated(vector3d<T> &other, f64 d)
yeah, will probably help when coding this... :lol:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

You could probably do this with animators too, but either way would work. Shouldn't be hard which ever way you choose.
don't eat yellow snow !!!
Why? Yellow snow's the tastiest. :lol:
multum in parvo
Ghus
Posts: 13
Joined: Wed May 12, 2010 5:42 pm

Post by Ghus »

hi all

thanks for the reply (sorry if my english is not perfect :wink: )

so can i do something like this

const core::vector3df newPos;
f32 percent0to1 = 1.f * (timer->getTime() - startTime) / timeToTake;
if (1 < percent0to1) {
// we're done
}
else
{
newPos = startPos.getInterpolated(endPos, percent0to1);
node->setPosition(newPos);
}

can i use get interpolated and make the same thing with the rotation?
my rotation is in vec3 format also
Post Reply