Page 1 of 1

Follow spline editor

Posted: Wed Jun 27, 2007 5:45 am
by ikam
hello

I've build a little tool for edit in real time a spline on an .irr scene. It can export spline attributes in xml to use in extern irrlicht app for easy use of the FollowSpline Animator.

I've build it initially to easy create a follow path for my camera , but it can used for other like stuff.

This is a first version created very quickly with maybe some bugs and need improvements but if it can helps you...

http://dakila.free.fr/splineed.zip

features:

- load an irr scene
- edit position of every control points
- add new control point or delete
- render to simulate a camera follow spline
- render to simulate a cube follow spline
- export attributes (controls points, tightness, speed) of spline in xml


CONTROL KEYS


// move position of controls node
1 = -X
2 = +X
3 = -Y
4 = +Y
5 = -Z
6 = +Z

// select control node
+ = next index
- = previous index

// add or delete point control (add after the last, or delete the last)
Q = add
W = delete

// render test
C = Camera follow spline render
V = camera fps
B = cube follow spline render

// increase step of deplacement for node
PAGE UP key = increase step
PAGE DOWN key = decrease step

// files operations
O = OpenFile Dialog for select .irr scene
P = Write xml of spline animator attributes

// speed of deplacement on spline for camera or cube render, need to restart render (key C or B)
S = speed up
D = speed down

// degree of bend for spline
T = +
Y = -


screens

Image

Posted: Wed Jun 27, 2007 6:36 am
by Virion
This is really nice and could be very useful to all of us. great tool. :D

Posted: Wed Jun 27, 2007 2:38 pm
by MarcoTMP
Yeah, this tool is really nice!.

@Niko, what about adding this feature to irredit? :wink:

Posted: Wed Jun 27, 2007 11:58 pm
by liger13
yah, that would be great. no more walking through and finding every point :P

Posted: Thu Jun 28, 2007 7:29 am
by Hirogen
What about the sources?
Is your tool Open Source?
I mean, the saved spline attributs can't be loaded without your software, or can they?

Posted: Thu Jun 28, 2007 8:30 am
by roxaz
1st post and such a contribution. im impressed :)

Posted: Thu Jun 28, 2007 12:21 pm
by ikam
thks, I'm happy if this little tool can help you.

The source will be available soon. I need to clean and reorganize it a little, cause i've made it quickly and it's a bit ugly.
Moreover the comment are in french :p so i need to translate them, I prefere to give you a clean source code.

The spline attributs can be loaded without this tool (this is the goal).

exemple to load spline.xml created by my tool :

Code: Select all

// create a cube to animate it with a spline animator 
	scene::ISceneNode * cubeNode = smgr->addCubeSceneNode(30);

	// read spline.xml
    io::IXMLReader* xmlReader = device->getFileSystem()->createXMLReader("spline.xml");	

	// if xml reader ok
    if (xmlReader)
    {
		// create attributs receiver
		io::IAttributes* attribs = device->getFileSystem()->createEmptyAttributes();

		// load attributs from xml
		attribs->read(xmlReader);	  

		// create an empty spline animator
		scene::ISceneNodeAnimator * sa = smgr->createFollowSplineAnimator(0,0);
		
		// load attributs into the spline animator	
		sa->deserializeAttributes(attribs);

		// add the spline animator to the cube
		cubeNode->addAnimator(sa);

		// clean resources
		sa->drop();
		attribs->drop();      
    } 

	// drop xml reader
	xmlReader->drop();

- there is a bug when writting spline.xml, the speed is not correctly reported and it's always set to 0.1, so you need to change it mannually in the xml. I will correct this soon
- i'd like also to add some gui elements to set this tool more efficient.

Posted: Fri Jun 29, 2007 11:19 am
by noreg
The source will be available soon. I need to clean and reorganize it a little, cause i've made it quickly and it's a bit ugly.
Moreover the comment are in french :p so i need to translate them, I prefere to give you a clean source code.
Very nice tool. That will be useful for scripted architectural walkthroughs and game fmv´s. PLEASE leave the original (french) comments intact when you translate. More people program better than they translate :wink: Merci.

Posted: Sun Mar 21, 2010 4:22 pm
by mikeyranks
This is great though how did you calculate and draw the curves?

Posted: Sat Apr 03, 2010 10:55 am
by Linkin Puck
mikeyranks wrote:This is great though how did you calculate and draw the curves?
I second this.

Assuming Ikam is not around any more, how would others approach this?

Re: Follow spline editor

Posted: Fri Nov 23, 2012 2:24 pm
by ikam
Hi guys

it's been a while I didn't post here, I was busy with another software, but I come back because I'm coding an new project with irrlicht.

so sorry I forgot to give sources... it's done now.

it's an old version (irrlicht 1.3.1), so maybe it need some fix...

sources

Re: Follow spline editor

Posted: Fri Nov 23, 2012 3:25 pm
by ACE247
I'm sure it can fixed up to the latest svn version :)
Thanks for uploading this anyways even if it was already so old.