Camera/object movement along path

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
Makumba666
Posts: 4
Joined: Wed Jul 02, 2008 12:05 pm

Camera/object movement along path

Post by Makumba666 »

Hi all,
Is it possible to draw some path (suppose some complex curve) in IrrEdit or some 3d design program and then move camera/object along that path?
I dont mean some mathematical masturbation inside program code - just some invisible spline made in 3d designer.
Is such thing possible?
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

yes, there is a scene node animator in irrlicht called follow spline scene node animator. (ESNAT_FOLLOW_SPLINE )
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah the spline animator (Demo application in the examples folder of the SDK has one of these in action) will do the trick. It doesn't draw it for you though, but you don't actually seem to need that option so that's fine!
Image Image Image
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Don't listen to these hippies. No, Irrlicht does not provide any built-in mechanism to load a spline that was created in an external application. You have to use "mathematical masturbation" to define all the points.

However, you could model and save out an invisible mesh composed of nothing but joints, and automate the masturbation, something like this:

Code: Select all

    core::array<core::vector3df> points;
    scene::IAnimatedMeshSceneNode * joints = smgr->addAnimatedMeshSceneNode(smgr->getMesh("splinesMesh.X"));
    for(u32 jointId = 0; jointId < joints->getJointCount(); ++jointId)
    {
        scene::IBoneSceneNode * joint = joints->getJointNode(jointId);
        points.push_back(joint->getPosition());
    }

    scene::ISceneNodeAnimator * splineAnimator = smgr->createFollowSplineAnimator(device->getTimer()->getTime(), points);
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I call for rogerborg to be banned for talking about automated masturbation!
Image Image Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

rogerborg wrote:Don't listen to these hippies. No, Irrlicht does not provide any built-in mechanism to load a spline that was created in an external application. You have to use "mathematical masturbation" to define all the points.

However, you could model and save out an invisible mesh composed of nothing but joints, and automate the masturbation, something like this:

Code: Select all

    core::array<core::vector3df> points;
    scene::IAnimatedMeshSceneNode * joints = smgr->addAnimatedMeshSceneNode(smgr->getMesh("splinesMesh.X"));
    for(u32 jointId = 0; jointId < joints->getJointCount(); ++jointId)
    {
        scene::IBoneSceneNode * joint = joints->getJointNode(jointId);
        points.push_back(joint->getPosition());
    }

    scene::ISceneNodeAnimator * splineAnimator = smgr->createFollowSplineAnimator(device->getTimer()->getTime(), points);
damn, that's bordering fetishism already.

good code. been lookin for a solution but hesitated to ask it here.
Image
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

Bah! It doesn't curve in motion there, just a broken line movement, not to mention all the must.

If you want a really nice curly motion, without any coding at all, don't listen to these punks and hippies. I mean really smooth movement with camera looking around and everything. No programming at all. Don't listen to anyone.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

i will use this technique when i set up a sample custscene sometime later. the code is a good example, tho i still need to figure out how to synch it to a dialog. and background music is something i have to study too.

a custscene manager is needed, then a cutscene class will have to be coded. i'm sure there's going to be a timeline object in there along with quaternions and slerp as well.

there's just too much complexity right there, hope i can do it and make a sample custscene.
Image
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Careful! Don't tell us too much about your ideas or we might steal them and trade them for beer and hookers.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply