-
October 8th, 2011, 08:54 AM
#1
how to draw minor arc not major arc
2 2 -110.000000 51.500000 10.000000 170.000004 270.000228
Dear Friends
I am give a set of data in the above form. Its an arc data. leaving the first 2 colmuns,
3rd column = centerX
4th column = centerY
5th column = radius
6th column = startAngle
7th column = endAngle
So I am drawing this but my boss is telling I am drawing the major arcs not the minor arcs. So I need to draw the minor arcs. can u tell me some one how can I draw minor arcs.
Check my algorithms
I am generating vertices like this.
float* CRevolutionProjView::getArcVerts(float pos_x, float pos_y,
float radius,
float angle_start, float angle_end,
unsigned int detail_level)
{
float* verts = (float *)malloc(sizeof(float) * 3 * detail_level);
float angle_delta = angle_end - angle_start;
float angle_step = angle_delta / (detail_level - 1);
float angle = angle_start;
int cnt=0;
while(detail_level){
verts[cnt] = pos_x + (cos(angle) * radius);
verts[cnt+1] = pos_y + (sin(angle) * radius);
verts[cnt+2] = 0.0f;
angle += angle_step;
cnt+=3;
--detail_level;
}
return verts;
}
After generating vertices through the above api I am drawing GL_LINE_STRP in arrays.
So whats wrong I am doing, please help me someone. Thanks in advance. sujan
-
October 13th, 2011, 01:11 AM
#2
Re: how to draw minor arc not major arc
-
October 16th, 2011, 06:45 AM
#3
Re: how to draw minor arc not major arc
Thanks my friend its done. Thanks a lot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|