コード例 #1
0
        public void DrawEditHandles(Vector3 entityscale)
        {
            // + x
            graphics.SetMaterialColor(editing3d.GetEditHandleColor(Axis.PosX));
            //graphics.SetMaterialColor( new double[]{ 1.0, 0.0, 0.0, 0.5 } );
            RendererFactory.GetPicker3dModel().AddHitTarget(new HitTargetEditHandle(Axis.PosX));
            graphics.PushMatrix();
            graphics.Scale(entityscale);
            graphics.Rotate(90f, 0f, 1f, 0f);
            DrawSelectionHandle();
            graphics.PopMatrix();

            // + y
            graphics.SetMaterialColor(editing3d.GetEditHandleColor(Axis.PosY));
            RendererFactory.GetPicker3dModel().AddHitTarget(new HitTargetEditHandle(Axis.PosY));
            graphics.PushMatrix();
            graphics.Scale(entityscale);
            graphics.Rotate(90, 1, 0, 0);
            DrawSelectionHandle();
            graphics.PopMatrix();

            // + z
            graphics.SetMaterialColor(editing3d.GetEditHandleColor(Axis.PosZ));
            RendererFactory.GetPicker3dModel().AddHitTarget(new HitTargetEditHandle(Axis.PosZ));
            graphics.PushMatrix();
            graphics.Scale(entityscale);
            //Gl.glRotatef( 90, 0, 1, 0 );
            DrawSelectionHandle();
            graphics.PopMatrix();
        }
コード例 #2
0
ファイル: Editing3dScale.cs プロジェクト: beyonddiana/osmp-cs
        void DrawSingleEditHandle(Vector3 entityscale, Vector3 handlescale, Axis handleaxis)
        {
            graphics.PushMatrix();
            graphics.SetMaterialColor(editing3d.GetEditHandleColor(handleaxis));
            RendererFactory.GetPicker3dModel().AddHitTarget(new HitTargetEditHandle(new Axis(handleaxis)));
            double fTranslateAmount = (handleaxis.GetAxisComponentIgnoreAxisDirection(entityscale) + handleaxis.GetAxisComponentIgnoreAxisDirection(handlescale)) / 2;

            graphics.Translate(fTranslateAmount * handleaxis.ToVector());
            graphics.Scale(handlescale);
            graphics.Rotate(handleaxis.ToRot());

            graphics.DrawCube();

            graphics.PopMatrix();
        }