 |
SceneViewPoint3DTo2D(Vector3, Camera, Single, Single) Method |
Point3DTo2D converts a world space 3D point (as Vector3) to the 2D point (as Vector2) on the view that is defined by specified camera, viewWidth and viewHeight.
Namespace: Ab4d.SharpEngineAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 3.1.9316+94bbd23b55747f096f056a5602f7dd90558b3673
Syntaxpublic Vector2 Point3DTo2D(
Vector3 point3D,
Camera camera,
float viewWidth,
float viewHeight
)
Parameters
- point3D Vector3
- 3D point in world space as Vector3
- camera Camera
- camera
- viewWidth Single
- width of the view
- viewHeight Single
- height of the view
Return Value
Vector2Point2D in the screen coordinates or Vector2(float.NaN, float.NaN) when the conversion matrix cannot be created
Remarks
Point3DTo2D converts a world space 3D point (as Vector3) to the 2D point (as Vector2) on the view that is defined by specified camera, viewWidth and viewHeight.
If the matrix to convert 3D point to 2D point cannot be calculated (for example if the size of this SceneView is not set), the returned point will be Vector2(float.NaN, float.NaN).
To convert multiple 3D points, use the Points3DTo2D(Vector3, Vector2, Camera, Single, Single, Transform, Boolean, Boolean) method.
See Also