how to draw pixel in directx9?
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..............
hmm maybe you can create an bitmap in memory where you draw the pixels into and then just display that bitmap on the screen
thanks..
but i need to draw those nodes pixel by pixel... so that they remain the same size when the world is zoomed in or out..
but i need to draw those nodes pixel by pixel... so that they remain the same size when the world is zoomed in or out..
You could go for pretransformed vertices; these are not affected by any matrices.
If you need exact pixel display you want to look up "Directly mapping texels to pixels".
If you need exact pixel display you want to look up "Directly mapping texels to pixels".
Quote:Original post by abijoshI 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.
if i can draw the nodes using drawpixel routine instead of the drawprimitive routine the app would be faster than it is now
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?
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?
Quote:Original post by abijoshA 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().
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?
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement