D3D Circle vertex problem

Started by
1 comment, last by Cosmy 13 years, 5 months ago
Hi all,

const float PI = 3.14159265f;const float DEGTORAD = PI / 180.0f; // DEGTORAD * degreesbool SetCustomVertex(CUSTOMVERTEX *pVertex, float x, float y, float z, float rhw, D3DCOLOR Color, float tu, float tv){	if (!pVertex)		return false;	pVertex->x = x;	pVertex->y = y;	pVertex->z = z;	pVertex->rhw = rhw;	pVertex->Color = Color;	pVertex->tu = tu;	pVertex->tv = tv;	return true;}void Draw2DCircle(UINT uX, UINT uY, D3DCOLOR Color, float fRadius){	CUSTOMVERTEX Vertex[360];	for (int i = 0; i < 360; i++)	{		float f = DEGTORAD * i;		SetCustomVertex(&Vertex,			(float)(uX + cos(f) * fRadius),			(float)(uY + sin(f) * fRadius),			0.5f,			1.0f,			Color,			0.0f,			0.0f);	}	g_pDevice->SetFVF(D3DFVF_CUSTOMVERTEX);	g_pDevice->SetTexture(0, NULL);	g_pDevice->DrawPrimitiveUP(D3DPT_POINTLIST, 360, &Vertex[0], sizeof(Vertex[0]));}


The problem is:
[image]http://img228.imageshack.us/img228/7972/immaginefpk.png[/image]

There are some points that aren't filled
Advertisement
I would say it's simply a matter of not being able to guarantee a set of points will actually have "full" pixel coverage. For example, if you were to zoom in then you'll start seeing spaces between points. Why not try D3DPT_LINESTRIP, which will draw a line from each point to the next.
Quote:Original post by aryx
I would say it's simply a matter of not being able to guarantee a set of points will actually have "full" pixel coverage. For example, if you were to zoom in then you'll start seeing spaces between points. Why not try D3DPT_LINESTRIP, which will draw a line from each point to the next.


Now:
http://img261.imageshack.us/img261/3829/immagine2ft.png

This topic is closed to new replies.

Advertisement