Page 1 of 1

Drawing Curves and Lines

Posted: Fri Nov 02, 2007 10:23 am
by thomascheah
1. How do I draw a curves (both 2D and 3D) in Irrlicht?

2. How do I draw lines with different thickness in Irrlicht?

Thanks!

Posted: Fri Nov 02, 2007 11:27 am
by hybrid
which kind of curves do you need? There is no spline support in Irrlicht as of now, but you can use the linestrip primitives to approximate curves (manually).
Line thickness can only be done using OpenGL, DX does not support line thickness (we will have to mimick it with small polygons, but that will be done much later).

Posted: Tue Nov 06, 2007 7:41 pm
by Namek Kural
Is there no way to draw a spline? I need one for the FollowSplineAnimator :(

Posted: Tue Nov 06, 2007 8:12 pm
by Halifax
How about, a bezier(however you spell that) cure?

Posted: Tue Nov 06, 2007 8:15 pm
by Namek Kural
bezier(however you spell that)
That was right! :D

Is it possible to use these bezier curves as splines for FollowSplineAnimator?

Posted: Tue Nov 06, 2007 9:02 pm
by Halifax
No I was saying, implement your own bezier curves, and your own animator. It wouldn't really be that hard, and then you could also write a plugin for irrEdit to use it.

Posted: Tue Nov 06, 2007 11:04 pm
by hybrid
The followspline animator calculates a cubic spline from the support points you give it. No need to reinvent the wheel.
If you want to draw that spline (in order to visualize the way) this is another point, that's not possible.

Posted: Wed Nov 07, 2007 3:08 pm
by Namek Kural
Thanks! Don't forget to answer the first post! Bye

Posted: Tue Nov 13, 2007 5:29 am
by thomascheah
I am sure if Irrlicht provide include certain methods like CatMullRom in DirectX SDK, that will solve the above once and for all, both for drawing curvee and animating through curve path.

Posted: Tue Nov 13, 2007 8:49 am
by hybrid
No, for drawing splines we will need to have some additional primitives. Calculating the splines on our own will only be necessary for the software drivers, because hardware drivers have built-in support.

Posted: Fri Jan 16, 2009 10:28 pm
by trnrez
Has support for drawing splines been added?

Posted: Fri Jan 16, 2009 11:21 pm
by hybrid
No, nothing in that direction has happened.

Posted: Sat Jan 17, 2009 1:45 pm
by Darktib
if you want to draw splines, you'll have to implement it yourself.

It is not very hard, here is a link :
http://www.gamedev.net/reference/progra ... /page2.asp

It explains you how to use splines in 2d, but the adaptation in 3d is not very hard.

Note that there is a mistake in the parametric equations:

Code: Select all

x = At^3 + Bt^2 + Ct + D
y = Et^3 + Ft^3 + Gt + H 
should be

Code: Select all

x = At^3 + Bt^2 + Ct + D
y = Et^3 + Ft^2 + Gt + H