Base |
public bool Line3DTo2D( Point3D startPositionWorld, Point3D endPositionWorld, out Point startPositionScreen, out Point endPositionScreen )
Converts a 3D line that is defined by startPositionWorld and endPositionWorld to a line on the screen that is defined by startPositionScreen and endPositionScreen.
This method correctly handles the case when the 3D line crosses the camera near plane (goes behind the camera). In this case the line needs to be cropped at the camera near plane.
The matrix to convert 3D point to 2D point is calculated from the used Ab3d.Camera. The matrix value is cached and is only recalculated when the camera is changed.
If the matrix to convert 3D point to 2D point cannot be calculated (for example if TargetViewport3D is not set), the calculated points will be Point(double.NaN, double.NaN) and the method will return false as a result.
To use Line3DTo2D method without attaching the camera to real Viewport3D you can use Line3DTo2D(Point3D, Point3D, Size, Point, Point).