ILNumerics Ultimate VS

IPickingResultVerticesWorld Property

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
3-dim array with detailed vertex information of the primitives picked as object coordinates

[ILNumerics Visualization Engine]

Namespace:  ILNumerics.Drawing
Assembly:  ILNumerics.Drawing (in ILNumerics.Drawing.dll) Version: ILNumerics Ultimate VS 4
Syntax

RetArray<float> VerticesWorld { get; }

Property Value

Type: RetArraySingle
Remarks

The data for each primitive are stored as matrix slices along the 0-1 dimension. One such slice is stored for each primitive along the third dimension. The length of VerticesWorld in the third dimension VerticesScreen.S[2] therefore gives the number of primtives picked.

If the specified 'target' shape in the call to PickPrimitiveAt(Drawable, Point, Int64, Boolean) is of a triangle type (Triangles,TrianglesStrip, or TrianglesFan) then the storage is as follows:

VerticesWorld is of size 3 x 4 x n, where n is the number of primitives picked.

VerticesWorld [:;:;0]
x1  y1  z1  s
x2  y2  z2  t
x3  y3  z3  ZI

Here, x1..x3 are the object X coordinates of the closest triangle under the screen point provided to PickPrimitiveAt(Drawable, Point, Int64, Boolean). Y1...Y3 and Z1...Z3 are the Y and Z vertex object coordinates corrspondingly.

s and t are the barycentric coordinates of the point provided in terms of the barycentric coordinate system for the triangle. Using s and t makes it easy to interpolate over the area of the triangle. In order to, let's say interpolate the Z value for the point given, one can use the following formula:

Z_i = z1 * s + z2 * t + z3 * (1-s-t)

Note that ZI in the result represents exactly that interpolated Z value at the point given.

For target shapes of type Lines the storage layout of VerticesWorld is as follows:

VerticesScreen [:;:;0]
x1  y1  z1  t
x2  y2  z2  ZI
Here, t is the fractional position of the projection of point onto the line connecting the vertices stored in x1,x2,y1,y2,z1,z2. In order to compute the X coordinate of the vertex position of the mouse cursor in terms of the picked line primitive, on can use the following formula:
x1 * t + x2 * (1 - t)
or
x1 + (x2 - x1) * t.

For Points targets the storage scheme is as follows:
VerticesScreen [:;:;0]
x1  y1  z1  D
Here, D denotes the current distance from the point picked and the mouse location. D is at most Points.Width.

Note that all values in VerticesWorld do relate to the true extend of the primitive as stored in the shapes vertex buffer. This may or may not directly correspond to the primitive rendered on screen. A common situation where there is no direct correspondence is when clipping occours. If the primitive was clipped at the panels rendering area or at some custom clipping plane, the values given in VerticesWorld correspond to the original primitive, the values in VerticesScreen correspond to the clipped primitive.

[ILNumerics Visualization Engine]

See Also

Reference