當前位置: 首頁>>代碼示例>>C#>>正文


C# Autodesk.endGL方法代碼示例

本文整理匯總了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();
        }
開發者ID:EricTRocks,項目名稱:Maya-devkit,代碼行數:76,代碼來源:footPrintNode.cs


注:本文中的Autodesk.endGL方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。