3D projection information

I have a 3D scene built from many of the elements of Model3D.
I need to create a 2D layer at the top where I want to associate 2D elements with Model3D elements.
How can I calculate the 2D predicted boundaries of Model3D elements?

0
source share
1 answer

Model3D does not have this information, since projection is a view / viewport property.

You can use the GeneralTransform3DTo2D class and, in particular, TransformBounds

This returns a rectangle with a two-dimensional axis ( Rect ) from the supplied three-dimensional bounding box. Pass the bounding box of your Model3D into this, and it will return the projected borders.

So, you can get this conversion once and use it for each Model3D in your scene as needed.

+1
source

Source: https://habr.com/ru/post/915644/


All Articles