Search code examples
wpfviewport3d

Light follow camera in viewport3D


Is there a way to set ANY light to follow the camera. thanks.


Solution

  • You can do it in XAML. Bind the location to the Camera's location and add an offset by adding a TranslateTransform.

    Be careful what you bind to though. If you are moving the camera by using a transform of the camera you will need to bind to the transformation of the camera, not the location.