本文整理匯總了C#中Autodesk.endGL方法的典型用法代碼示例。如果您正苦於以下問題:C# Autodesk.endGL方法的具體用法?C# Autodesk.endGL怎麽用?C# Autodesk.endGL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Autodesk
的用法示例。
在下文中一共展示了Autodesk.endGL方法的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();
}