2016年3月14日 星期一

week 4 Jim_c OpenGL

classwork 1


>http://www.cmlab.csie.ntu.edu.tw/~jsyeh/3dcg10/
>download and extract
>data,win32,glut32.lib
classwork 2

glRotate (xxx)for rotation
gkRotate(xxx,x,y,z)for controlling direction

classwork 3


using mouse control in cmd
>
void mouse(int button,int state,int x,int y)
{
    if(state==GLUT_DOWN)
        printf("  glVertex2f((%d-150)/150.0,-(%d-150)/150.0);\n",x,y);
//get the point easily in cmd window
//copy and paste in help ours work quicker

}
> glutMouseFunc(mouse);   // in (int main)

classwork 4

>drawing circle in c#
>using (math.h) function // sin ,cos
>drawing cricle
 glPushMatrix();
        glBegin(GL_POLYGON);
        for(float angle=0;angle<3.1459265357989 *2;angle+=0.1)  //sin cos drawing
        {
            glVertex2f(0.2*cos(angle),0.2*sin(angle));
        }

沒有留言:

張貼留言