WPF PerspectiveCamera and projection - why does item disappear?

WoodManEXP 1 Reputation point
2022-07-28T12:44:18.99+00:00

Trying to understand how the PerspectiveCamera handles 3D to 2D projection and Near/FarPlaneDistance. In this example a Model3DGroup has a single GeometryModel3D which is a sphere mesh with diameter 1,392,700 centered at (0,0,0). Camera's FarPlaneDistance = 2.5E09, and NearPlaneDistance = 1.5E6.

With Camera looking at (0,0,0) at distance 22,805,665 the scene looks like

225861-image.png

At distance 23,801,973 the scene looks like

225812-image.png

And at distance 24,798,579 the sphere is no longer visible, it disappears

225862-image.png

What is causing the sphere to disappear? It does not seem too far away to project; it is within the NearPlaneDistance and FarPlaneDistance planes.

Any thoughts as to why the item disappears from the scene?

Thanks!

Developer technologies Windows Presentation Foundation
{count} votes

1 answer

Sort by: Most helpful
  1. WoodManEXP 1 Reputation point
    2023-08-13T14:09:27.05+00:00

    The answer to this is has to do with rounding as WPF projects from the 3D World to the 2D screen coordinates. It was using really large 3D World coordinate values After they were scaled down by a few orders of magnitude the projections behave better.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.