Drawing Curves and Lines

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
thomascheah
Posts: 77
Joined: Sat Jul 08, 2006 5:55 am
Location: Cyberjaya, Malaysia

Drawing Curves and Lines

Post 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!
Objective World Pvt. Ltd.
"Turning Knowledge Into Wisdom."
http://www.objectiveworld.com
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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).
Namek Kural
Posts: 81
Joined: Sun Sep 09, 2007 7:01 pm
Location: BW, Germany

Post by Namek Kural »

Is there no way to draw a spline? I need one for the FollowSplineAnimator :(
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

How about, a bezier(however you spell that) cure?
TheQuestion = 2B || !2B
Namek Kural
Posts: 81
Joined: Sun Sep 09, 2007 7:01 pm
Location: BW, Germany

Post by Namek Kural »

bezier(however you spell that)
That was right! :D

Is it possible to use these bezier curves as splines for FollowSplineAnimator?
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post 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.
TheQuestion = 2B || !2B
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
Namek Kural
Posts: 81
Joined: Sun Sep 09, 2007 7:01 pm
Location: BW, Germany

Post by Namek Kural »

Thanks! Don't forget to answer the first post! Bye
thomascheah
Posts: 77
Joined: Sat Jul 08, 2006 5:55 am
Location: Cyberjaya, Malaysia

Post 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.
Objective World Pvt. Ltd.
"Turning Knowledge Into Wisdom."
http://www.objectiveworld.com
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
trnrez
Posts: 28
Joined: Wed Dec 27, 2006 5:56 pm
Location: Murfreesboro, TN
Contact:

Post by trnrez »

Has support for drawing splines been added?
Jon Jones
Portfolio - needs updating
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, nothing in that direction has happened.
Darktib
Posts: 167
Joined: Sun Mar 23, 2008 8:25 pm
Location: France

Post 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 
Post Reply