コード例 #1
0
ファイル: MapViewerPanel.cs プロジェクト: bschwind/Sky-Slider
        public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            base.LoadContent(content);

            map = new Map(Device, "startPosTest.txt");
            //        map = new Map();
            BlockData.Initialize(Device, content);
            primBatch = new PrimitiveBatch(Device);

            MeshBuilder mb = new MeshBuilder(Device);
            mb.Begin();

            //mb.AddCylinder(1, 1, 50);
            mb.AddSphere(1, 20, 20);
            testMesh = mb.End();

            mNode = new MeshNode(testMesh);
            mNode.SetPivot(new Vector3(0, -1f, 0));
            mNode.SetScl(new Vector3(1, 5, 1));
            MeshNode child = new MeshNode(testMesh);
            child.SetPos(new Vector3(0, 2, 0));
            MeshNode another = new MeshNode(testMesh);
            another.SetPos(new Vector3(0, 2, 0));

            //Mesh sphere = mb.CreateSphere(0.1f, 10, 10);
            //startMarker = new MeshNode(sphere);
            //startMarker.SetPos(map.StartPos);
            //child.AddChild(another);
            //mNode.AddChild(child);
        }
コード例 #2
0
ファイル: BallDemo.cs プロジェクト: bschwind/Graphics-Demos
        public override void LoadContent(ContentManager content, GraphicsDevice g)
        {
            base.LoadContent(content, g);

            primBatch = new PrimitiveBatch(Device);
            cam = new FirstPersonCamera(0.5f, 10);
            cam.Pos = new Vector3(3, 3, 13);

            MeshBuilder mb = new MeshBuilder(Device);
            mb.Begin();
            mb.AddSphere(radius, 20, 20);
            Mesh sphereMesh = mb.End();

            sphere = new MeshNode(sphereMesh);
            sphere.SetPos(new Vector3(5, 5, 5));

            planes = new List<Plane>();
            planes.Add(new Plane(Vector3.Right, 0));
            planes.Add(new Plane(Vector3.Up, 0));
            planes.Add(new Plane(new Vector3(0, 0, 1), 0));
            planes.Add(new Plane(Vector3.Left, -10));
            planes.Add(new Plane(Vector3.Down, -10));
            planes.Add(new Plane(new Vector3(0, 0, -1), -10));
        }