Page 1 of 1

line3d

Posted: Tue Feb 24, 2004 2:10 am
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.

Posted: Tue Feb 24, 2004 3:01 am
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)

Posted: Tue Feb 24, 2004 10:34 pm
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!?

Posted: Tue Feb 24, 2004 10:36 pm
by Miwa
The other thing is you should be aware of the constructor to SColor, I think you are doing RGBA instead of ARGB.

Posted: Wed Feb 25, 2004 7:45 am
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.