Beispiel #1
0
        public void Create(float spokeLen, float spokeRad, float centerRad, float arrowLen, float arrowRad)
        {
            float      ang90 = (float)(Math.PI / 2.0);
            Cylinder3d cn;

            axisInd = new List <Object3d>();

            // x arrow
            cn = new Cylinder3d();
            cn.Create(arrowRad, 0.0f, arrowLen, 8, 2);
            cn.SetColor(Color.Red);
            cn.Rotate(0, ang90, 0);
            cn.Translate(spokeLen + arrowLen / 2 - 0.1f, 0, -arrowLen / 2);
            axisInd.Add(cn);
            cn = new Cylinder3d();
            cn.Create(spokeRad, spokeRad, spokeLen, 8, 2);
            cn.Rotate(0, ang90, 0);
            cn.Translate(spokeLen / 2, 0, -spokeLen / 2);
            cn.SetColor(Color.Red);
            axisInd.Add(cn);

            // y arrow
            cn = new Cylinder3d();
            cn.Create(arrowRad, 0.0f, arrowLen, 8, 2);
            cn.SetColor(Color.Green);
            cn.Rotate(-ang90, 0, 0);
            cn.Translate(0, spokeLen + arrowLen / 2 - 0.1f, -arrowLen / 2);
            axisInd.Add(cn);
            cn = new Cylinder3d();
            cn.Create(spokeRad, spokeRad, spokeLen, 8, 2);
            cn.Rotate(-ang90, 0, 0);
            cn.Translate(0, spokeLen / 2, -spokeLen / 2);
            cn.SetColor(Color.Green);
            axisInd.Add(cn);

            // z arrow
            cn = new Cylinder3d();
            cn.Create(arrowRad, 0.0f, arrowLen, 8, 2);
            cn.SetColor(Color.Blue);
            cn.Translate(0, 0, spokeLen);
            axisInd.Add(cn);
            cn = new Cylinder3d();
            cn.Create(spokeRad, spokeRad, spokeLen, 8, 2);
            cn.SetColor(Color.Blue);
            axisInd.Add(cn);

            // center
            //Object3d sp = Primitives.Sphere(centerRad, 7, 8);
            //sp.SetColor(Color.Yellow);
            //axisInd.Add(sp);
            float r = centerRad;

            axisCent            = Quad3d.CreateQuadBox(-r, r, -r, r, -r, r);
            axisCent[0].imgname = "axisx";
            axisCent[1].imgname = "axisx";
            axisCent[2].imgname = "axisy";
            axisCent[3].imgname = "axisy";
            axisCent[4].imgname = "axisz";
            axisCent[5].imgname = "axisz";
        }
        void AddPlatWalls()
        {
            float platX, platY, platZ;

            platX   = (float)UVDLPApp.Instance().m_printerinfo.m_PlatXSize / 2;
            platY   = (float)UVDLPApp.Instance().m_printerinfo.m_PlatYSize / 2;
            platZ   = (float)UVDLPApp.Instance().m_printerinfo.m_PlatZSize;
            m_walls = Quad3d.CreateQuadBox(-platX, platX, -platY, platY, 0, platZ, "WarnWall");
        }