Archived

This topic is now archived and is closed to further replies.

randomDecay

Drawing triangles in D3D

Recommended Posts

Hi. I am trying to draw a triangle with a certain exterior color and a certain interior color. I have tried using D3DPT_LINESTRIP (which just draws the exterior of the triangle) and D3DPT_TRIANGLELIST which draws interior of the triangle. Is there any way to draw a triangle with a certain exterior and interior color? Thanks. [edited by - randomDecay on November 1, 2002 1:50:58 AM]

Share this post


Link to post
Share on other sites
Draw it twice. Once with inside color, then with outside color with the WIREFRAME filling mode.

Go read about filling mode (D3DRS_FILLMODE)in Direct3D documentation for more info.

______________________________
Oooh, you found the horadric cube!

Share this post


Link to post
Share on other sites
Or similarly, draw it with the inner colour set and scaled down slightly (you''ll have to play with values to get something good), then draw it with the outer colour at standard scaling but slightly behind. Using a Z-Buffer there won''t be any overdraw. Many cards implement wireframe by rendering a triangle per line and it may be slower.


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites