internal static Rect ProjectBounds( ref Matrix3D viewProjMatrix, ref Rect3D originalBox) { D3DMATRIX viewProjFloatMatrix = CompositionResourceManager.Matrix3DToD3DMATRIX(viewProjMatrix); MILRect3D originalBoxFloat = new MILRect3D(ref originalBox); MilRectF outRect = new MilRectF(); HRESULT.Check( MIL3DCalcProjected2DBounds( ref viewProjFloatMatrix, ref originalBoxFloat, out outRect)); if (outRect.Left == outRect.Right || outRect.Top == outRect.Bottom) { return Rect.Empty; } else { return new Rect( outRect.Left, outRect.Top, outRect.Right - outRect.Left, outRect.Bottom - outRect.Top ); } }
private extern static /*HRESULT*/ int MIL3DCalcProjected2DBounds( ref D3DMATRIX pFullTransform3D, ref MILRect3D pboxBounds, out MilRectF prcDestRect);