1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47:
| public void render() { mausStatus = maus.CurrentMouseState; mausButtons = mausStatus.GetMouseButtons(); if (mausButtons[1] != 0) { rotationX -= 0.01f * mausStatus.X; rotationY -= 0.01f * mausStatus.Y; rotationZ -= 0.05f * mausStatus.Z;
}
if (mausButtons[0] != 0) { punktX -= 0.01f * mausStatus.X; punktY -= 0.01f * mausStatus.Y; punktZ -= 0.01f * mausStatus.Z; } . . . . Funktion rendern{ m_Device.BeginScene(); for (int i = 0; i < mesh.NumberAttributes; i++) { m_Device.Material = material[i]; m_Device.Transform.World = Matrix.RotationYawPitchRoll(rotationX, rotationY, 0);
mesh.DrawSubset(i); } for (int i = 0; i < mesh2.NumberAttributes; i++) { world = Matrix.Identity; world = Matrix.Scaling(0.0f, 0.5f, 0.5f); world *= Matrix.RotationX(380); m_Device.Material = material2[i];
m_Device.Transform.World = Matrix.Translation(punktX, punktY, punktZ);
mesh2.DrawSubset(i); } } |