line3d

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
jugurdzija
Posts: 26
Joined: Thu Feb 05, 2004 10:58 pm

line3d

Post by jugurdzija »

this code:

driver->draw3DLine(vector3df(0,-100,0),vector3df(0,100,0),video::SColor(0,255,0,255));
driver->draw3DLine(vector3df(-100,0,0),vector3df(100,0,0),video::SColor(0,0,255,255));
driver->draw3DLine(vector3df(0,0,-100),vector3df(0,0,100),video::SColor(255,0,0,255));

gives me four lines instead of three,why.

they are all black also.
Miwa
Posts: 28
Joined: Wed Feb 18, 2004 10:48 pm

Post by Miwa »

You'll need to set a material to have the lines be displayed.

Set an ambient color in the material, and the lines will be that color.

(at least that's what happens when I just call DrawPrimativeUP directly with D3DPT_LINELIST)
jugurdzija
Posts: 26
Joined: Thu Feb 05, 2004 10:58 pm

Post by jugurdzija »

i have lines displayed,but i wanted only three lins like x,y,z axis but there was a 4th one here too!?
Miwa
Posts: 28
Joined: Wed Feb 18, 2004 10:48 pm

Post by Miwa »

The other thing is you should be aware of the constructor to SColor, I think you are doing RGBA instead of ARGB.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

The additional wrong line is a bug in the engine, but should only occur with D3D8 and 9. You could fix it by yourself by simply changing the implementation: In the line, where DrawPrimitive() is called, change the parameter from 2 to 1.
Post Reply