我如何在过剩/ OPENGL中做到这一点?

时间:2015-02-21 06:59:58

标签: opengl glut vertex helix

https://math.stackexchange.com/questions/945033/helix-around-helix-parametric-equation

我试过这个但是我没有得到结果:

for(float u=0; u<1.0; u+=0.3/lados)
 {
     glBegin(GL_LINE_STRIP);
     u2=u+1.0/lados;
     for(float v=0; v<=1.0; v+=0.1/lados)
     {
                      glVertex3f(R+(r*cos(u2*2*PI))*cos(u2*2*PI),R+(r*cos(u2*2*PI))*sin(u*2*PI), (0.2*u2*2*PI)+sin(u2*2*PI));*/

        glVertex3f((R+(r*cos(u*2*PI)))*cos(u2*2*PI),(R+(r*cos(u*2*PI)))*sin(u*2*PI), (u*2*PI*0.5)+.2*sin(u*2*PI));

         glVertex3f((R+(r*cos(u2*2*PI)))*cos(u2*2*PI),(R+(r*cos(u2*2*PI)))*sin(u2*2*PI),(u2*2*PI*0.5)+.2*sin(u2*2*PI));
     }
     glEnd();
 }

提前致谢。

0 个答案:

没有答案