How do I enlarge the point by POINTLIST
How do I enlarge the point by POINTLIST?
g_pd3dDevice->DrawPrimitive(D3DPT_POINTLIST, 0, 3);
The point occupies one pixel in the screen.
How do I enlarge the point?(The vertex fvf of the point is D3DFVF_XYZRHW|D3DFVF_DIFFUSE)
Look at the states for SetRenderState, specifically D3DRS_POINTSIZE_MIN.
Why do you want to do this though? Surely drawing textured quads would be better?
Why do you want to do this though? Surely drawing textured quads would be better?
There's a minor "trick" involved in casting a float to a DWORD to set the point size.
Actually, drawing points of a fixed pixel size can be very convenient, in a modeling program, for instance, which shows selected vertices. The points remain the same size on the screen whatever the eye distance and their positions are easily calculated as the position of the vertex! Quick and simple.
float fPSize = 5.0f; // 5 pixelspDevice->SetRenderState(D3DRS_POINTSIZE,*(DWORD*)&fPSize);
Quote:Surely drawing textured quads would be better?
Actually, drawing points of a fixed pixel size can be very convenient, in a modeling program, for instance, which shows selected vertices. The points remain the same size on the screen whatever the eye distance and their positions are easily calculated as the position of the vertex! Quick and simple.
Quote:Original post by Evil Steve
Look at the states for SetRenderState, specifically D3DRS_POINTSIZE_MIN.
Why do you want to do this though? Surely drawing textured quads would be better?
Thank you! I chaned the value of D3DRS_POINTSIZE_MIN, but it did not work. So I finded another way to change the size of the point by defining the FVF(D3DFVF_PSIZE).
#define VERTEXFVF_2D_POINT (D3DFVF_XYZRHW|D3DFVF_PSIZE|D3DFVF_DIFFUSE)
I already draw a full-screen quad on screen. And then I want to add some points on the quad.
"drawing textured quads would be better?" means what? by sprite to draw a circle replace of the point? Could you say the detail?
Quote:I chaned the value of D3DRS_POINTSIZE_MIN, but it did not work
Evil Steve mistyped.[smile] It's D3DRS_POINTSIZE.
EDIT: By the way, akira32, POINTs on the screen are draw as a square of pixels of the specified size and aren't subject to perspective. They'll appear the same size on the screen no matter what their position in world-space.
Original post by Buckeyefloat fPSize = 5.0f; // 5 pixelspDevice->SetRenderState(D3DRS_POINTSIZE,*(DWORD*)&fPSize);
quote]
Thank you, Buckeye! I try the D3DRS_POINTSIZE, it does work.
Sorry!Evil Steve. I try the D3DRS_POINTSIZE_MIN, it also works. I forgot the trnasformation from float to DWORD(I just used the DWORD value).
Quote:Original post by akira32It depends on what you're trying to do. Drawing textured quads allows you to rotate the points, and apply a texture to them if you want to.
"drawing textured quads would be better?" means what? by sprite to draw a circle replace of the point? Could you say the detail?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement