Jump to content
  • Advertisement
Sign in to follow this  
hoogie

Problems using ID3DXLINE

This topic is 4869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

Share this post


Link to post
Share on other sites
Advertisement
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.

hth
Jack

Share this post


Link to post
Share on other sites
ID3DXLINE is for 2D lines? I wasn’t sure if that was the case, if so then yeah I definitely shouldn’t be using it.

Is there anyway to change the properties of lines being drawn via the DrawPrimitive function? As in changing the width of lines etc?

Thanks for the reply JollyJeffers, you always seam to help me out with my queries ;-)

Share this post


Link to post
Share on other sites
Quote:
Original post by hoogie
ID3DXLINE is for 2D lines? I wasn’t sure if that was the case, if so then yeah I definitely shouldn’t be using it.

To quote the official documentation:

Quote:
ID3DXLine::Draw Method
Draws a line strip in screen space


Quote:
Original post by hoogie
Is 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 hoogie
Thanks 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]

Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!