views:

64

answers:

1

I'm trying to draw a line with the DrawPrimitive function in Direct3D.

Can I draw tranparent line with the function? If I can, how to design it?

+2  A: 

I am not a DirectX expert, but I don't believe transparency has anything to do with the DrawPrimitive() function specifically.

I would look into the SetRenderState() function to enable alpha blending, and then assign some color/texture properties to your geometry.

Also, if you are just drawing a single line you may not see anything since a line by itself wouldn't have any width. I'm guessing you actually want to draw some triangles or quads or something instead of just a line.

bde
Line width can be set, I think (you can on some hardware, not sure if it's part of DirectX or not). If not, they are single-pixel-width, and you can in fact see them. :)
dash-tom-bang