[ILNumerics Visualization Engine]
Namespace: ILNumerics.Drawing
Assembly: ILNumerics.Drawing (in ILNumerics.Drawing.dll) Version: ILNumerics Ultimate VS 4
Property Value
Type: RetArraySingleThe 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 VerticesScreen 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) if of a triangle type (Triangles,TrianglesFan, or TrianglesStrip) then the storage is layed out as follows:
VerticesScreen is of size 3 x 4 x n, where n is the number of primitives picked.
VerticesScreen [:;:;0]
x1 y1 z1 s
x2 y2 z2 t
x3 y3 z3 ZI
Here, x1..x3 are the screen X coordinates of the closest triangle under the point provided to PickPrimitiveAt(Drawable, Point, Int64, Boolean). Y1...Y3 and Z1...Z3 are the Y and Z screen coordinates correspondingly.
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 VerticesScreen is as follows:
VerticesScreen [:;:;0]
x1 y1 z1 t
x2 y2 z2 ZI
x1 * t + x2 * (1 - t)
x1 + (x2 - x1) * t.
VerticesScreen["end;end;:"][":"]
VerticesScreen [:;:;0]
x1 y1 z1 D
Note that the values in VerticesWorld relate to the true extend of the primitive as stored in the shape 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 rendering edge (frustum) or at some custom clipping plane, the values given in VerticesWorld correpond to the original primitive, the values in VerticesScreen correspond to the clipped triangle.
[ILNumerics Visualization Engine]