I have a 3D scene constructed of many Model3D elements.
I need to create a 2D layer on top where I want to associate 2D elements with Model3D elements.
How can I calculate the 2D projected bounds of Model3D elements?
I have a 3D scene constructed of many Model3D elements. I need to create
Share
The
Model3Ddoesn’t have that information as the projection is a property of the view/viewport.You can use the
GeneralTransform3DTo2DClass and specifically theTransformBoundsmethodThis returns a 2D axis aligned box (
Rect) from the 3D bounding box supplied. Pass the bounding box of yourModel3Dinto this and it will return the projected bounds.So you can get this transformation the once and use it for each
Model3Din your scene as appropriate.