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.
AlfAlien
Posts: 20 Joined: Tue Jan 28, 2014 2:08 pm
Post
by AlfAlien » Wed Mar 05, 2014 11:12 am
I need to draw line in 3d (white line on black background). I use OpenGL driver. Similar function that draws 2d line works great, but draw3DLine doesn't work.
Code: Select all
while(device->run())
{
driver->beginScene(true, true, video::SColor(255,0,0,0));
driver->draw3DLine(core::vector3df(0, 0, 0), core::vector3df(100, 100, 100)); //not working
//driver->draw2DLine(core::position2d<s32>(0,0), core::position2d<s32>(100,100)); //working
driver->endScene();
}
What's wrong?
Last edited by
AlfAlien on Wed Mar 05, 2014 12:58 pm, edited 1 time in total.
AlfAlien
Posts: 20 Joined: Tue Jan 28, 2014 2:08 pm
Post
by AlfAlien » Wed Mar 05, 2014 12:58 pm
Thank you, very much!
I didn't know because read only documentation/comments inside source files.
horvatha4
Posts: 12 Joined: Sun Feb 23, 2014 6:03 am
Location: Rheiland-Pfalz, Germany
Contact:
Post
by horvatha4 » Tue Apr 01, 2014 4:20 pm
Hi!
This code draw only black lines. Equal where and what color I set. The transform is ok.
Code: Select all
irr::video::SMaterial debugmaterial;
debugmaterial.DiffuseColor = irr::video::SColor( 0xFFFFFF00 );
debugmaterial.AmbientColor = irr::video::SColor( 0xFFFFFF00 );
this->avideodriver->setMaterial( debugmaterial );
this->avideodriver->setTransform(irr::video::ETS_WORLD, irr::core::IdentityMatrix);
this->avideodriver->draw3DLine(
irr::core::vector3df(from.getX(), from.getY(), from.getZ() ),
irr::core::vector3df(to.getX(), to.getY(), to.getZ() )
//,irr::video::SColor( 256, 128, 128, 0 )
);
What made I wrong?
I use Windows7 64 bit and Visual Express 2010.
Thanks
Arpi
CuteAlien
Admin
Posts: 9734 Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:
Post
by CuteAlien » Tue Apr 01, 2014 4:30 pm
Set debugmaterial.Lighting = false.
horvatha4
Posts: 12 Joined: Sun Feb 23, 2014 6:03 am
Location: Rheiland-Pfalz, Germany
Contact:
Post
by horvatha4 » Tue Apr 01, 2014 4:37 pm
Yess!
Thanks a lot!
Arpi
p.s I post this because my irr::scene::SMesh draw only black lines and triangles too. Set Light=false solve all the problem.
Everything is black till I add a Light (scene node)?