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? p.e. 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开发者_JAVA百科 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:
- Take the center of the MeshGeometry3D by using the Bounds property and add the normal vector several times to position the Camera.
- 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
精彩评论