Sign in to follow this  

how to draw pixel in directx9?

This topic is 3671 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

hi, i wanna know how to draw or plot pixels in directx9? i'm working on an app in which u can create path and graphs.. if i can draw the nodes using drawpixel routine instead of the drawprimitive routine the app would be faster than it is now.. and also i din't find any default routine for drawpixel in direcx.. help please......... thanks..............

Share this post


Link to post
Share on other sites
Quote:
Original post by abijosh
if i can draw the nodes using drawpixel routine instead of the drawprimitive routine the app would be faster than it is now
I sincerely doubt it. 3D graphics hardware is designed to deal with 3D primitives, not 2D pixels. Manually drawing 2D pixels is pretty hard on the graphics card.

Share this post


Link to post
Share on other sites
oops..
is there any way to keep the size of the objects to be the same regardless of the world transform? in fact i'm calculating the scale matrix during every render cycle to display the nodes in the same size.. but the calculation is too expensive for every single routine.. so thats y i thought of using draw pixel routine.. can anyone suggest a better way to fix it?

Share this post


Link to post
Share on other sites
Quote:
Original post by abijosh
oops..
is there any way to keep the size of the objects to be the same regardless of the world transform? in fact i'm calculating the scale matrix during every render cycle to display the nodes in the same size.. but the calculation is too expensive for every single routine.. so thats y i thought of using draw pixel routine.. can anyone suggest a better way to fix it?
A perspective projection matrix will make objects further from the camera appear smaller (like real life). You can use an orthogonal projection matrix instead to not scale objects with camera distance (Like CAD applications). See D3DXMatrixOrthoLH().

Share this post


Link to post
Share on other sites
I was thinking about ortho as well, but if what he wanted to do was say, render what actually looked like a 3D cube at an angle, and have that remain the same size, but still look 3D. Then rendering it using ortho would make it look flat and "weird".

It's hard to really tell since you gave us so little info about what you are actually trying to do.

What it sounds like to me is it is almost a HUD type overlay? So as the 3D scene is zoomed in, this is over it and stays the same size? If thats the case, you can just pop the matrix all the way out, then render it, and it wont be affected by the "zoom-ness" of the matrix.

But thats pretty easy and you dont sound like a noob, so I doubt its that simple. But like I said it's hard to know with how little info you gave us.

Share this post


Link to post
Share on other sites
hey i tried that ortho.. but it didnt workout so well as it had the same prob as Wavesonics told..

i'm sorry that the info is too little..

here it is..

consider there are two buildings and a path is being created between them..

in that case - if i zoom in or out the size of buildings and other nodes in the scene will vary.. but i dont want the size of the path nodes to vary..

Share this post


Link to post
Share on other sites

This topic is 3671 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this