Draw3DLine

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
jpeq
Posts: 8
Joined: Fri Jun 02, 2006 2:29 am
Location: Berkeley, CA

Draw3DLine

Post by jpeq »

I really don't get it yet...
How can I put a line in the 3D space inside a node?
Like,

Code: Select all

scene::ISceneNode* MyNode = 0;
MyNode = driver->draw3DLine(core::vector3df(0.0f,0.06f,0.0f), core::vector3df(55.0f,0.06f,0.0f), video::SColor(255,100,101,140));

The compiler simply tells me that there's an incompatibility of types. How to solve it?

Thanks.[/i]
Ecliptic Fate
Posts: 19
Joined: Tue Apr 26, 2005 6:10 am

Post by Ecliptic Fate »

old ..
Last edited by Ecliptic Fate on Mon Sep 27, 2010 1:17 am, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The compiler error you get is due to the void return value of the method. You simply call that method and the line is drawn. No scene node that is generated. The line is simply drawn to the buffer and will be removed in the next drawing cycle. That's why you either have to call it from the main render loop or from within a scene node's render method.
jpeq
Posts: 8
Joined: Fri Jun 02, 2006 2:29 am
Location: Berkeley, CA

Post by jpeq »

Ecliptic Fate:

I want to be able to select some lines, and display information about them. I guess it must be embeded in a node somehow for that. Or not?


hybrid:

I did it from the main render node, and it worked great. But I still can't interact with it. How can I call it from within a scene node?


Thanks.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You have to create a custom scene node, i.e. create a CLineSceneNode.h and .cpp which implements the necessary methods. In render() you call the draw3dLine(). Then you can use the scene node methods.
jpeq
Posts: 8
Joined: Fri Jun 02, 2006 2:29 am
Location: Berkeley, CA

Post by jpeq »

Hybrid:

AAAAAAAAAAAHHHHHHHH!!!!
I see!

That solves my problem (so far).

Many thanks!
Post Reply