示例#1
0
        /// <summary>
        /// Create Direct3D device and swap chain
        /// </summary>
        protected void InitDevice()
        {
            device = D3DDevice.CreateDeviceAndSwapChain(directControl.Handle, out swapChain);

            SetViews();

            meshManager = new XMeshManager(device);
            mesh = meshManager.Open("Media\\Tiger\\tiger.x");

            InitMatrices();
        }
示例#2
0
        /// <summary>
        /// Create Direct3D device and swap chain
        /// </summary>
        protected void InitDevice()
        {
            device    = D3DDevice.CreateDeviceAndSwapChain(directControl.Handle);
            swapChain = device.SwapChain;

            SetViews();

            meshManager = new XMeshManager(device);
            mesh        = meshManager.Open("Media\\Tiger\\tiger.x");

            InitMatrices();
        }
示例#3
0
        /// <summary>
        /// Create Direct3D device and swap chain
        /// </summary>
        public void InitDevice()
        {
            device    = D3DDevice.CreateDeviceAndSwapChain(host.Handle);
            swapChain = device.SwapChain;

            SetViews();

            meshManager = new XMeshManager(device);
            mesh        = meshManager.Open("Media\\Tiger\\tiger.x");

            InitMatrices();
            needsResizing = false;
        }
示例#4
0
        private void LoadMesh(string filename)
        {
            lock (meshLock)
            {
                if (mesh != null)
                {
                    mesh.Dispose();
                    mesh = null;
                }

                worldMatrix = Matrix4x4F.Identity;

                XMesh meshT = meshManager.Open(filename);

                meshT.ShowWireFrame = cbWireframe.Checked;

                mesh = meshT;
            };
        }
示例#5
0
        void InitScene()
        {
            // load mesh
            meshManager = new XMeshManager(device);
            mesh        = meshManager.Open <Texturizer>(@"Resources\airplane 2.x");
            // initialize camera
            camera = new PerspectiveCamera(
                new Point3D(0, 0, -10),
                new Vector3D(0, 1, 0),
                new Vector3D(0, 1, 0),
                45);
            camera.NearPlaneDistance = .1;
            camera.FarPlaneDistance  = 500;

            // initialize camera transforms
            modelTransformGroup.Children.Add(modelZoom);
            modelTransformGroup.Children.Add(new RotateTransform3D(yAxisRotation));
            modelTransformGroup.Children.Add(new RotateTransform3D(xAxisRotation));
            modelTransformGroup.Children.Add(new RotateTransform3D(zAxisRotation));
        }
        void InitScene()
        {
            // load mesh
            meshManager = new XMeshManager(device);
            mesh = meshManager.Open<Texturizer>(@"Resources\airplane 2.x");
            // initialize camera
            camera = new PerspectiveCamera(
                new Point3D(0, 0, -10),
                new Vector3D(0, 1, 0),
                new Vector3D(0, 1, 0),
                45);
            camera.NearPlaneDistance = .1;
            camera.FarPlaneDistance = 500;

            // initialize camera transforms
            modelTransformGroup.Children.Add(modelZoom);
            modelTransformGroup.Children.Add(new RotateTransform3D(yAxisRotation));
            modelTransformGroup.Children.Add(new RotateTransform3D(xAxisRotation));
            modelTransformGroup.Children.Add(new RotateTransform3D(zAxisRotation));
        }
        /// <summary>
        /// Create Direct3D device and swap chain
        /// </summary>
        public void InitDevice()
        {
            device = D3DDevice.CreateDeviceAndSwapChain(host.Handle);
            swapChain = device.SwapChain;

            SetViews();

            meshManager = new XMeshManager(device);
            mesh = meshManager.Open("Media\\Tiger\\tiger.x");

            InitMatrices();
            needsResizing = false;
        }