Instrinsic-189 Set3DObjectData

intrinsic-189 Set3DObjectData

Top  Previous  Next

189: Set3DObjectData(Handle, Array, Count, Color, Width);

 

This intrinsic enables you to add triangles to meshes or lines to Line-objects as an array of real values. This makes it easy to set large numbers of triangles or lines and is faster than using the Add3DTriangle, the Add3DRectangle or the Add3DLine intrinsics.

 

Arguments:

 

Handle. This argument is an integer handle created by the Add3DObject intrinsic. The handle must be for a mesh or a Line-object.

 

Array. This is a pointer to an array of reals. If the object specified by the Handle is a mesh, then the reals are interpreted as triangles. Each triangle consists of three X, Y and Z coordinates that specify the vertices of the triangle. If the object specified by the Handle is a Line-Object, then the reals are interpreted as lines. Each line consists of two X, Y and Z coordinates that specify the beginning and ending points of the line segment. Since the value is an array, you must pass the address of the beginning of the array. For example:

 

real Triangles;

 

Triangles:=[-1.0,-1.0,-1.0, -1.0, 1.0, 1.0,  1.0, 1.0,-1.0, 

            -1.0,-1.0,-1.0,  1.0, 1.0,-1.0,  1.0,-1.0, 1.0, 

            -1.0,-1.0,-1.0,  1.0,-1.0, 1.0, -1.0, 1.0, 1.0, 

            -1.0, 1.0, 1.0,  1.0,-1.0, 1.0,  1.0, 1.0,-1.0];

 

Set3DObjectData(WrkMesh, @Triangles(0), 2, $FF0000FF, 1);

 

 

Count. This is the number of reals in the array. If the array is used to specify triangles, the count should be the number of triangles times nine. If the array is used to specify lines, the count should be the number of lines times six.

 

Color. This value sets the color of all the triangles or lines being added to the object.

 

Width. This values sets the width of the lines if the handle specifies a line-object.