Click or drag to resize
Ab4d.SharpEngine logo

SceneViewPoints3DTo2D(Vector3, Vector2, Transform, Boolean, Boolean) Method

Points3DTo2D calculates 2D screen positions from the specified 3D positions. To calculate the 2D positions for the final UI element, set the adjustByDpiScale to true otherwise the 2D positions will be positioned inside the view defined by SceneView's Width and Height. Calculated 2D positions are stored into the specified points2D array (its size must be at least the size of the 3D positions).

Namespace: Ab4d.SharpEngine
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public bool Points3DTo2D(
	Vector3[] points3D,
	Vector2[] points2D,
	Transform? transform = null,
	bool adjustByDpiScale = false,
	bool useParallelFor = false
)

Parameters

points3D  Vector3
array of 3D positions defined as Vector3
points2D  Vector2
array that will be filled with 2D positions on the screen
transform  Transform  (Optional)
when not null, then transformation is applied to all positions
adjustByDpiScale  Boolean  (Optional)
when true (false by default), then the 2D positions will be adjusted by DPI scale (to get positions on the final UI element)
useParallelFor  Boolean  (Optional)
when true, then Parallel.For loop is used

Return Value

Boolean
true when the calculation was successful, false when the camera is not fully initialized and its matrix is not correct
See Also