简体   繁体   中英

Viewport 3D WPF C# - Several Questions

what is the best way to position the Camera in a way that i can see what i paint in a certain region? pe I'm painting a rectangle at around 300,400,2200. Where do i have to place the camera and which view do i have to set so that everything fits "in"? Is there a trick or a special method or do i have to try it out with different camera positions?

There is no standard function that will position the camera this way because there are many options (think of different sides and rotations)

A trick you could use is:

  1. Take the center of the MeshGeometry3D by using the Bounds property and add the normal vector several times to position the Camera.
  2. Then use the normal vector of the plane, invert it and use it as the LookDirection for the camera.

How far you need to move the camera depends on the view angle of the camera. It can be calculated. Let me know if you want to know how (it will take me a little extra time)

More information can be found here too

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM