/// <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(); }
/// <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(); }
/// <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; }
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; }; }
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)); }