3D line with color pattern?

Started by
2 comments, last by LeLe 22 years, 5 months ago
How can I render a 3D line with the color pattern applying on it?And the width of line can be specialized.
Advertisement
I''m only familiar with OpenGL, so here is what I know

What you want is called Line Stippling in OpenGL. Unfortunately you can only stipple patters of Color,No color, but you can draw lines on top of lines to get multiple patterns. The function is glLineStipple(int factor, GLushort patter) where factor is some number i don''t understand when its other than 1 and pattern is 16 bits that define Color,No color. The line width can be set to a number of pixels with glLineWidth(int width). Again these are only for OpenGL, but DirectX probably has something similar.

RELIGION IS THE ROOT OF ALL EVIL
Ambassador: Mr. Bush are you stoned or just really, REALLY dumb?Pres. Bush - I assure you I am not stoned.
If you want to change line thickness, render the lines as textured quads. If you want to specify the lines in screen space, use an ortho projection matrix D3DXMatrixOrthoLH.
What you can do is using a gradient, say for example one end of the line yellow, the other one blue and the line itself will blend smoothly those 2 colors. To do this you must give the two vertices a diffuse color.

This topic is closed to new replies.

Advertisement