Archived

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

JohanK

Lines

Recommended Posts

JohanK    122
What are the fundamentals of drawing the equavialent of a line in 3d space... And how does it apply to dx8. How do you make a wireframe of an object? The purpose is for debugging, I want to see the generated boundingboxes for my objects. Thanks /Johan

Share this post


Link to post
Share on other sites
Kippesoep    892
That's pretty easy. They work the same way as triangles, but they have only 2 vertices. When calling DrawPrimitive, you would specify something like D3DPT_TRIANGLELIST for triangles. For lines, use D3DPT_LINELIST. You'll probably want to disable texture mapping for them



Edit: oops. That should be D3DPT_LINELIST, of course.

[edited by - Kippesoep on March 18, 2002 6:06:04 AM]

Share this post


Link to post
Share on other sites
Giallanon    1893
To render in wireframe:
pDevice->SetRenderState (D3DRS_FILLMODE,D3DFILL_WIREFRAME)

To render solid
pDevice->SetRenderState (D3DRS_FILLMODE,D3DFILL_SOLID);


pDevice is supposed to be a valid pointer to DX8

Share this post


Link to post
Share on other sites
JohanK    122


To render in wireframe:
pDevice->SetRenderState (D3DRS_FILLMODE,D3DFILL_WIREFRAME)

To render solid
pDevice->SetRenderState (D3DRS_FILLMODE,D3DFILL_SOLID);


Can you switch mode during between begin and end, ie, drawing one objekt using D3DFILL_WIREFRAME and the other using D3DFILL_SOLID?

Share this post


Link to post
Share on other sites