driver->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
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

driver->draw3DLine

Post by dehseth »

Hi,

I want to draw a 3d line on the screen to debug smt. but driver->draw3DLine command draws my line in wrong place. I have two meshes which both are moving objects. And draw line always has an offset of last object center:

Code: Select all

driver->draw3DLine(core::vector3df(0,0,0), core::vector3df(xAxis.z(), xAxis.y(), xAxis.x()), video::SColor(255, 0, 0, 255));
I expect this code would draw a line from origin of world to point xAxis, but vector(0,0,0) is the center of last drawn mesh.... How can I reset this? I want a line from origin of world to xAxis point... Thanks...
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

Post by dehseth »

ok I find it...

Code: Select all

driver->setTransform(video::ETS_WORLD, core::matrix4());
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Don't forget to set the driver's material too otherwise it will use the material of the last object it rendered.
Image Image Image
Post Reply