3D Lines?

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
CodeJackk
Posts: 2
Joined: Sat Oct 18, 2014 11:08 pm

3D Lines?

Post by CodeJackk »

Hello!

So I'm trying to work out how to draw a 3D line in a circle. I cannot figure out how to work the line3d(http://irrlicht.sourceforge.net/docu/cl ... ine3d.html).

Kinda newish to C++.

Thanks for any help :)
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: 3D Lines?

Post by CuteAlien »

Can you show what you tried so far?

Basically it's:
1. Get a videodriver (see any examples, they all use one). 2. Set the material used for linedrawing (typically a video::SMaterial with lighting disabled)
3. Reset the draw transformation before starting to draw lines (that is unless you want to have a transformation). Usually you call: videodriver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
4. Draw the line with videodriver->draw3DLine and give it the start and end-points as parameter. Optionally a color.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CodeJackk
Posts: 2
Joined: Sat Oct 18, 2014 11:08 pm

Re: 3D Lines?

Post by CodeJackk »

CuteAlien wrote:Can you show what you tried so far?

Basically it's:
1. Get a videodriver (see any examples, they all use one). 2. Set the material used for linedrawing (typically a video::SMaterial with lighting disabled)
3. Reset the draw transformation before starting to draw lines (that is unless you want to have a transformation). Usually you call: videodriver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
4. Draw the line with videodriver->draw3DLine and give it the start and end-points as parameter. Optionally a color.
Thanks for the reply. I can manage to draw a 3D line now(although it's always black). But how can I draw a circle when the parameters are a start and end point?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: 3D Lines?

Post by CuteAlien »

There is no 3D circle support in Irrlicht (there is one for 2d with draw2DPolygon). But I found 2 posts in the forum which might help you with that:
http://irrlicht.sourceforge.net/forum/v ... =9&t=46059
http://irrlicht.sourceforge.net/forum/v ... =1&t=48744
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply