draw3DLine not showing specified color

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
yoes_san
Posts: 9
Joined: Mon Dec 11, 2006 7:22 am

draw3DLine not showing specified color

Post by yoes_san »

I try to draw a 3d line in my main loop.

The line shows just fine but not have a specified color, instead it has a texture that I set for another scene node as texture.

Why is that?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

You need to set the material [driver->setMaterial(mtl)] and the world transform [driver->setTransform(video::ETS_WORLD, mat)] just before you call driver->draw3DLine(). If you don't specify these, the graphics subsystem will use the last material and world transform that was set, and this usually comes from the last scene node that was rendered.

Travis
yoes_san
Posts: 9
Joined: Mon Dec 11, 2006 7:22 am

Post by yoes_san »

Thanks vitek, it's works as I intended now.
Post Reply