The Code feedback of CCV.(DrawCircleLoader function in calibration.cpp)
Posted: 12 March 2011 04:33 AM   [ Ignore ]
Avatar
Rank
Joined  2011-01-19
Total Posts:  35
New Member

The job of DrawCircleLoader is to draw a fan-shaped circle, so we can change the parameter of glBegin() to GL_TRIANGLE_FAN. ( Original is GL_TRIANGLES )

So the code will be changed to:

void Calibration::DrawCircleLoader(double xctrdouble yctrdouble radiusdouble startAngledouble endAngle)
{
    double vectorX
,vectorY;
    
double angle,ang0,ang1;

    
ang0 startAngle * ( PI/180.0);
    
ang1 endAngle * ( PI/180.0);
    
glBegin(GL_TRIANGLE_FAN);    //  GL_TRIANGLES -> GL_TRIANGLE_FAN
        
glVertex2dxctryctr );
        for(
angle=ang0angle ang1angle += PI/180.0{
            vectorX
xctr radius*cos(angle);
            
vectorYyctr radius*sin(angle);

            
glVertex2d(vectorX,vectorY);
        
}
    glEnd
();
    
glFlush();
}

I tested the code in my Win7 32bit OS( VS2008 ), and it works.

reference: http://en.wikibooks.org/wiki/OpenGL_Programming/Basics/2DObjects#Using_glBegin_with_GL_TRIANGLE_FAN
---

First I want to put the feedback to nuicode.com, but I can not login. (I created a new account, but when i login the system said:"Invalid user or password”, even if I recover my password)

Then I put the code here. Hope someone can help me “LOGIN”. ( my username is e10101 )

---
Again, as a new member of the community, What i want is to make more contribution to the community.smile

Profile
 
 
Posted: 12 March 2011 09:06 AM   [ Ignore ]   [ # 1 ]
Avatar
Rank
Joined  2009-04-13
Total Posts:  14
New Member

i had the same problem after creating a login too.

Profile
 
 
Posted: 17 March 2011 01:31 AM   [ Ignore ]   [ # 2 ]
RankRankRankRank
Joined  2009-08-21
Total Posts:  555
Elite

Okay , thanks for this. I will try it out and see ! Regarding the nuicode login issue, you need to contact Christian Moore. grin !

 Signature 

~~Amit~~

Blog - Twitter - Facebook

Profile
 
 
Posted: 18 March 2011 09:14 PM   [ Ignore ]   [ # 3 ]
Avatar
Rank
Joined  2011-01-19
Total Posts:  35
New Member
Amit - 17 March 2011 01:31 AM

Okay , thanks for this. I will try it out and see ! Regarding the nuicode login issue, you need to contact Christian Moore. grin !

Thanks for your advice!

Profile
 
 
   
 
 
‹‹ CCV adaptiveThreshold      CCV 1.4 ››