"
模块“OpenLuGl实用函数”已经编译，可以直接使用该模块的函数。
";

//让图形随鼠标移动。factor为比例因子，factor越大则移动幅度越大。
:::luglFollowMouse(factor:x,y,xx,yy,xxx,yyy,static,luglFollowMouse,xMouse,yMouse)=
{
    if[gleGetMouseMsg(WM_LBUTTONDOWN,&x,&y),luglFollowMouse=1,xMouse=x,yMouse=y],
    gleGetWindowSize[&xxx,&yyy],
    if[luglFollowMouse,gleGetMouseMsg(WM_MOUSEMOVE,&xx,&yy),gleAngle[1,gleAngle(1)+(yy-yMouse)/yyy*factor],gleAngle[2,gleAngle(2)+(xx-xMouse)/xxx*factor]],
    if[gleGetMouseMsg(WM_LBUTTONUP,&xx,&yy),luglFollowMouse=0],
    glRotated[gleAngle(1),1.0,0.0,0.0], //使图象沿X轴旋转
    glRotated[gleAngle(2),0.0,1.0,0.0], //使图象沿Y轴旋转
    glRotated[gleAngle(3),0.0,0.0,1.0]  //使图象沿Z轴旋转
};

~~~Scene(::pFun)=          //场景绘制函数
{
    glClear[],
    glColor3d[1.0,0.0,0.0],//设置颜色
    gleAxesAngle[],        //显示坐标和旋转角度
    glLoadIdentity[],
    glTranslated[0.0,0.0,-20.0],
    glColor3d[0.0,1.0,0.0],//设置颜色
    luglFollowMouse[2],    //通过鼠标拖动变换任意角度来观察物体
    pFun(0)                //绘制图形
};
:::luglPlot(f::pFun) = pFun=f, gleDrawScene[@Scene];  //传递图形绘制函数，启动绘图场景
