Exemplo n.º 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public MyModel()
        {
            mTheStack = new MatrixStack();

            mMajorAxis             = new AxisShape();
            mMajorAxis.Xform.Scale = new Vector3(10, 10, 10);

            mRoot = new SceneNode("Root");

            SceneNode arm = BuildArm("TopArm");

            mRoot.AddChild(arm);
            arm.Xform.RotateInYByRadian(MathHelper.PiOver2);
            arm.Xform.Translation = new Vector3(0, 15, 20);

            InitCameraParameters(arm);

            arm = BuildArm("BottomArm");
            mRoot.AddChild(arm);
            arm.Xform.Translation = new Vector3(0, 2, 0);

            SceneNode others = new SceneNode("Other Stuff");

            mRoot.AddChild(others);

            MeshShape m = new MeshShape("cone");

            m.Xform.Translation = new Vector3(-10, 3, 0);
            others.AddShape(m);

            SquareOnXZ s = new SquareOnXZ();

            s.Xform.Scale       = new Vector3(20, 20, 20);
            s.Xform.Translation = new Vector3(0, -2, 0);
            s.Color             = Color.DarkGray;
            others.AddShape(s);

            m = new MeshShape("shusui");
            m.Xform.Translation = new Vector3(8, 2, -10);
            m.Xform.Scale       = new Vector3(4f);
            others.AddShape(m);

            m = new MeshShape("bigship1");
            m.Xform.Translation = new Vector3(-5, 2, -5);
            m.Xform.Scale       = new Vector3(0.5f, 0.5f, 0.5f);
            others.AddShape(m);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public CameraVisualization()
        {
            mLookAt           = new SquareShapeWithAxis();
            mLookAt.Color     = Color.White;
            mLookAt.DrawPivot = true;

            mCameraPosition             = new CircleOnXZ();
            mCameraPosition.Color       = Color.Black;
            mCameraPosition.Xform.Scale = new Vector3(0.2f, 0.2f, 0.2f);
            mCameraPosition.DrawPivot   = true;

            mUpVectorPosition             = new SquareOnXZ();
            mUpVectorPosition.Xform.Scale = new Vector3(0.1f, 0.1f, 0.1f);
            mUpVectorPosition.Color       = Color.Red;
            mUpVectorPosition.DrawPivot   = true;

            mViewVector       = new LineShape();
            mViewVector.Color = Color.White;

            mUpVector       = new LineShape();
            mUpVector.Color = Color.Black;
        }