本文整理汇总了C#中Autodesk.beginGL方法的典型用法代码示例。如果您正苦于以下问题:C# Autodesk.beginGL方法的具体用法?C# Autodesk.beginGL怎么用?C# Autodesk.beginGL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autodesk
的用法示例。
在下文中一共展示了Autodesk.beginGL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: draw
public override void draw(Autodesk.Maya.OpenMayaUI.M3dView view, MDagPath path, Autodesk.Maya.OpenMayaUI.M3dView.DisplayStyle style, Autodesk.Maya.OpenMayaUI.M3dView.DisplayStatus status)
{
// Get the size
//
MObject thisNode = thisMObject();
MPlug plug = new MPlug( thisNode, size );
MDistance sizeVal = new MDistance();
plug.getValue( sizeVal );
float multiplier = (float) sizeVal.asCentimeters;
view.beginGL();
if ( ( style == M3dView.DisplayStyle.kFlatShaded ) ||
( style == M3dView.DisplayStyle.kGouraudShaded ) )
{
// Push the color settings
//
OpenGL.glPushAttrib( (uint)OpenGL.GL_CURRENT_BIT );
if ( status == M3dView.DisplayStatus.kActive ) {
view.setDrawColor( 13, (int)M3dView.ColorTable.kActiveColors );
} else {
view.setDrawColor(13, (int)M3dView.ColorTable.kDormantColors);
}
OpenGL.glBegin((uint)OpenGL.GL_TRIANGLE_FAN);
int i;
int last = footPrintData.soleCount - 1;
for ( i = 0; i < last; ++i ) {
OpenGL.glVertex3f(footPrintData.sole[i,0] * multiplier,
footPrintData.sole[i,1] * multiplier,
footPrintData.sole[i,2] * multiplier);
}
OpenGL.glEnd();
OpenGL.glBegin((uint)OpenGL.GL_TRIANGLE_FAN);
last = footPrintData.heelCount - 1;
for ( i = 0; i < last; ++i ) {
OpenGL.glVertex3f(footPrintData.heel[i,0] * multiplier,
footPrintData.heel[i,1] * multiplier,
footPrintData.heel[i,2] * multiplier);
}
OpenGL.glEnd();
OpenGL.glPopAttrib();
}
// Draw the outline of the foot
//
OpenGL.glBegin((uint)OpenGL.GL_LINES);
{
int last = footPrintData.soleCount - 1;
for (int i = 0; i < last; ++i)
{
OpenGL.glVertex3f(footPrintData.sole[i, 0] * multiplier,
footPrintData.sole[i, 1] * multiplier,
footPrintData.sole[i, 2] * multiplier);
OpenGL.glVertex3f(footPrintData.sole[i + 1, 0] * multiplier,
footPrintData.sole[i + 1, 1] * multiplier,
footPrintData.sole[i + 1, 2] * multiplier);
}
last = footPrintData.heelCount - 1;
for (int i = 0; i < last; ++i)
{
OpenGL.glVertex3f(footPrintData.heel[i, 0] * multiplier,
footPrintData.heel[i, 1] * multiplier,
footPrintData.heel[i, 2] * multiplier);
OpenGL.glVertex3f(footPrintData.heel[i + 1, 0] * multiplier,
footPrintData.heel[i + 1, 1] * multiplier,
footPrintData.heel[i + 1, 2] * multiplier);
}
}
OpenGL.glEnd();
view.endGL();
}