Quote:Original post by OrcishCoder
Another question to all: How to draw Arc and Eplise in DX8 or above?
Thanks
An arc is a portion of a circle or elipse. An elipse is a circle with the radius biased in either the x- or y-axis.
To draw an elipse, bias like this:
pkVertices [iVertex].m_fX = (float) ((float)iCenterX +((float)iRadius * xBias * cos (6.2831f*fComplete)));pkVertices [iVertex].m_fY = (float) ((float)iCenterY +((float)iRadius * yBias * sin (6.2831f*fComplete)));
To draw an arc, only calculate vertices in the area you need (ie, calculate positions in the loop for only a subset of those in the circle)
Or you could do everything my way and precalculate everything so you don't have to worry about the math .