Archived

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

johnnyBravo

Does d3d9 have a line drawing method(3d)

Recommended Posts

Im wondering if d3d9 has a line drawing method. Like i just say x,y,z, x2,y2,z2 and it draws it for me. ive been using primitive types like D3DPT_LINESTRIP with the vertex to draw them, but they have very big limitations , that is for each line you want to draw in a different position, u need another element in the vertex array. oh and i can't use the matrix as the lines will be of different lengths etc Thanks, [edited by - johnnyBravo on January 15, 2004 5:36:40 AM]

Share this post


Link to post
Share on other sites
"that is for each line you want to draw in a different position, u need another element in the vertex array."

Are you saying that the major limitation is that you need to specify where the vertices are for each line? I don''t understand your problem. How else would you specify where to draw the lines? I''m pretty sure that the only way to do lines in D3D is by this method, and the only drawback I can see is that you can''t specify line width or anything, which I''m pretty sure you can in OGL.

---------------------------------------

Let''s struggle for our dream of Game!

http://andrewporritt.4t.com

Share this post


Link to post
Share on other sites
I think the OP means that for every new line he has to make a new DrawPrimitive call when using line strips. If thats the case then just use line lists instead.

You could try ID3DXLine if you''re feeling masochistic. If you need textured and/or thick lines I recommend writing your own code for it. Or if you dont want to do that I''ve seen code for line drawing in D3D in the COTD section on flipcode before.

Share this post


Link to post
Share on other sites
quote:
Original post by f8k8


Are you saying that the major limitation is that you need to specify where the vertices are for each line? I don''t understand your problem.


what i mean is that i have to unlock and lock the vb each time i want to change the length of the line.

or does it not matter about locking etc the vb all the time, like no speed problems

treething ill look into what u r saying

Share this post


Link to post
Share on other sites
actually now that i think about it, i can just make a biggish vb

im just trying to draw the skeleton joints, so i can see the connections easier for the animation.

and for bullets i can just stick that into a matrix, some reason i forgot about that,

thanks all for your suggestions,

Share this post


Link to post
Share on other sites