Recommended Posts

Hey all,
Im am currently having a lot of difficulty using ID3DX line to draw lines, one of my main problems is that im struggling to understand how it works and as such cant implement it correctly.
I have a fully functioning particle system and am currently simulating rain by using the
g_D3dDevice->DrawPrimitive( D3DPT_LINELIST, 0, count );
command. I am now trying to move over to ID3DXLINE as it provides support for wider lines, making my lines transparent and will basically look much better.
What origenally confused me was that ID3DXLINE->DrawTransform() needs a transform matrix. Why is this?
The coordinates that my lines use are already in the correct space as they are functioning correctly with the DrawPrimitive call, however if I use these same coordinates within the ID3DXLINE->DrawTransform() function with a identity matrix nothing is rendered.
Could anyone please point me in the right direction for using ID3DXLINE correctly and on where I am going wrong?
Thanks a lot for any help

0

Share this post

Link to post

Share on other sites

A quick thought... ID3DXLine is for 2D lines - whereas a particle system is typically defined in 3D. If you pass it 3D coordinates then they're less likely to be valid for a 2D screenspace system thus giving you incorrect results.

Original post by hoogieIs there anyway to change the properties of lines being drawn via the DrawPrimitive function? As in changing the width of lines etc?

No, not really. You have to write the code to change the thickness of the lines. Exactly how you do this very much depends on how much work you're willing to put into it and what sort of results you're after. For example, a very simple hack might be to transform the start/end of the line from world->screen space and then use ID3DXLine...

Quote:

Original post by hoogieThanks for the reply JollyJeffers, you always seam to help me out with my queries ;-)

My pleasure! I actually live in these forums - I don't have a real house in the real world [smile]