CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2007
    Location
    Bangalore,India
    Posts
    164

    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

  2. #2
    Join Date
    Jul 2005
    Location
    Louisville, KY
    Posts
    201

    Re: how to draw minor arc not major arc

    Looks like you got a response, on http://www.opengl.org/discussion_boa...&Number=304123.

    H2H,
    Quinn

  3. #3
    Join Date
    Sep 2007
    Location
    Bangalore,India
    Posts
    164

    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
  •  





Click Here to Expand Forum to Full Width

Featured