public CameraController(Camera c, IListLayout l, PointLight p) { camera = (ProjectionCamera)c; layout = l; light = p; try { Transform3DGroup group = camera.Transform as Transform3DGroup; RotateTransform3D rot = group.Children[0] as RotateTransform3D; cameraRotX = rot.Rotation as AxisAngleRotation3D; rot = group.Children[1] as RotateTransform3D; cameraRotY = rot.Rotation as AxisAngleRotation3D; rot = group.Children[2] as RotateTransform3D; cameraRotZ = rot.Rotation as AxisAngleRotation3D; } catch (Exception ) { System.Diagnostics.Debug.WriteLine("camera transformations are wrong!!!"); } try { Transform3DGroup group = light.Transform as Transform3DGroup; RotateTransform3D rot = group.Children[0] as RotateTransform3D; lightRotX = rot.Rotation as AxisAngleRotation3D; rot = group.Children[1] as RotateTransform3D; lightRotY = rot.Rotation as AxisAngleRotation3D; rot = group.Children[2] as RotateTransform3D; lightRotZ = rot.Rotation as AxisAngleRotation3D; } catch (Exception ) { System.Diagnostics.Debug.WriteLine("light transformations are wrong!!!"); } }
public void ChangeLayout(IListLayout newLayout) { layout = newLayout; }