Esempio n. 1
0
        private void Viewport_CameraChanged(object sender, RoutedEventArgs e)
        {
            Vector3D cameraPosition = Viewport.Camera.Position.ToVector3D();

            cameraPosition.Normalize();
            LightsAxisRotationZ.SetValue(AxisAngleRotation3D.AngleProperty, Math.Atan2(cameraPosition.X, -cameraPosition.Y) * (180d / Math.PI) - 45d);
        }