I have drawn a 3D line with different color or alpha, but only black is rendered. I am using SCOLOR(A,R,G,B) for color and direct3d9 for the driver.
What could be causing this?
Also, is it possible to increase the width of a line.
Draw 3D Line Color Incorrect
-
- Posts: 20
- Joined: Sun Aug 27, 2006 9:10 pm
- Location: U.S.A.
- Contact:
i've no idea what happened to your code . But in my example code, i rendered a line every frame and the color is correct . And the color , of cource you must use SColor because the parameter is a SColor type.
ps:
Did your render loop like this :
I think if you did that , i mean , draw a line before ISceneManager::drawAll , you will get a blank line . I suppose you should :
And the color now will be correct . good luck .
Code: Select all
driver->draw3DLine( vector3df( 0, 100, 0 ), vector3df( 0, 0, 0 ), SColor( 255, 255, 0, 0 ) );
Did your render loop like this :
Code: Select all
render a line
scene manager draw all
Code: Select all
manager->drawAll();
driver->draw3DLine( vector3df( 0, 100, 0 ), vector3df( 0, 0, 0 ), SColor( 255, 255, 0, 0 ) );
You can't increase the width of the line unfortunately as then i guess it wouldn't technically be a line.. more a rectangle...
Not sure what other options there are, other than rendering a rectangle instead of a line. Or i suppose as it should be in 3d you'd want to render a cube that's stretched out.
Not sure what other options there are, other than rendering a rectangle instead of a line. Or i suppose as it should be in 3d you'd want to render a cube that's stretched out.