protected override void DoRender(RenderEventArgs arg)
{
// Set the projection matrix.(projection and view matrix actually.)
OpenGL.MatrixMode(OpenGL.GL_PROJECTION);
OpenGL.LoadIdentity();
arg.Camera.LegacyProjection();
// Set the modelview matrix.(just model matrix actually.)
OpenGL.MatrixMode(OpenGL.GL_MODELVIEW);
OpenGL.LoadIdentity();
this.LegacyTransform();
vec4 color = this.CurveColor.ToVec4();
OpenGL.Color(color.x, color.y, color.z, color.w);
this.CurveWidth.On();
//启用求值器
//必须在绘制顶点之前开启
OpenGL.Enable(OpenGL.GL_MAP2_VERTEX_3);
OpenGL.Enable(OpenGL.GL_AUTO_NORMAL);
// 计算网格
OpenGL.EvalMesh2(
(uint)this.MeshMode,
this.MinPercent.x, this.MaxPercent.x, this.MinPercent.y, this.MaxPercent.y);
this.CurveWidth.Off();
}