drawing 3d objects with vertices

The objects that appear in a 3D scene are graphical representations of physical objects. A 3D object is a prepare of vertices that be in 3D space and the connections made, or not made, between those vertices. The Geometries VIs such as Create Box and Create Sphere define the representation of uncomplicated geometric objects for you. If you lot desire to create an object that is more geometrically complex, or if you want to define specific values for the vertices, normals, indices, colors, and texture mapping that define the appearance of a 3D object, you tin configure a mesh.

Notation  Using meshes is an avant-garde 3D graphics design technique. Prior experience with designing 3D graphics may assist you utilise this characteristic.

A mesh is a collection of attributes that, when combined in a specific manner, create a 3D surface. The attributes of a mesh include vertices, normals, colors, texture coordinates and the points, lines, triangles, or polygons that delineate or connect the vertices. When you define a mesh, y'all ascertain arrays of values that represent the vertices, normals, colors, and texture coordinates of the mesh. You lot also ascertain an array of indices that determines where in the mesh to apply the values from each array. Finally, you define binding modes for the values in each of the arrays. To understand meshes, you must be familiar with the following terms:

  • Vertex—A point in 3D infinite that creates a corner indicate of the mesh. An x, y, and z coordinate define each vertex.
  • Primitive—An independent, visible face of a mesh. For example, if a mesh consists of three separate triangles, each triangle is a archaic of the mesh. Points, lines, triangles, quadrilaterals, and other polygons all can be primitives.
  • Normal—A vector that points in a direction perpendicular to the surface of the mesh. You can define a normal for each vertex or for each polygon in a mesh. The normals of a mesh define the orientation of the surface of the mesh relative to light sources.

In LabVIEW, you tin utilize the Create Mesh VI to create a reference to a new mesh. You then can use the SceneMesh properties and methods to configure the mesh programmatically. The post-obit section provides boosted data virtually the attributes of a mesh.

Draw Fashion

The draw manner you select for a mesh specifies the mode in which you desire to draw or connect the vertices of the mesh. You can select from the following describe modes.

Points

Draws a point over each vertex. This manner does not connect the split vertices, just the points appear in 3D space.

Lines

Draws non-contiguous line segments betwixt pairs of vertices. For case, LabVIEW draws a mesh with 4 vertices with ii lines: V0V1 and V2Vthree. If the total number of vertices is odd, LabVIEW ignores the final vertex.

Line Strip

Draws contiguous line segments between the vertices, starting at V0 and ending at V n – one, where northward is the total number of vertices. This mode connects all the vertices just does non create a airtight polygon.

Line Loop

Draws contiguous line segments betwixt the vertices, starting and ending at 50. This fashion creates a closed polygon, but does not fill the infinite enclosed by the line segments.

Triangles

Draws a serial of non-contiguous triangles that connect the vertices in groups of three, and fills the space enclosed by each triangle. For example, LabVIEW draws a mesh with six vertices with two triangles: V0VoneV2 and V35fourFivev. This mode does not connect the triangles to each other. If the full number of vertices is non an exact multiple of three, LabVIEW ignores the last 1 or two vertices.

Triangle Strip

Draws a serial of contiguous, filled triangles. LabVIEW connects the vertices so that the orientation of the triangles forms a solid strip, creating a portion of the object surface. For example, the beginning triangle connects the vertices V0V1Vii, the 2nd triangle connects the vertices V2V1Vthree, the third triangle connects the vertices V253V4, and so on.

Triangle Fan

Draws a serial of contiguous, filled triangles. The first vertex of each triangle is the same, and LabVIEW increments the second and third vertices past i for each subsequent triangle. This causes the triangles to create a fan around the central signal of 50. For example, the starting time triangle connects V0VaneV2, the 2d triangle connects V05iiV3, and so on.

Quads

Draws a series of non-face-to-face quadrilateral polygons that connect the vertices in groups of four, and fills the space enclosed by each quadrilateral. For case, LabVIEW draws a mesh with 8 vertices with two quadrilaterals: V0V1ViiV3 and Five4V5V6Fiveseven. If the full number of vertices is not an exact multiple of four, LabVIEW ignores the terminal one, two, or three vertices.

Quad Strip

Draws a series of face-to-face quadrilateral polygons, and fills the space enclosed by each quadrilateral. For example, LabVIEW draws a mesh with eight vertices with three quadrilaterals: V0V1V3V2, ViiV35fiveV4, and VfourVfiveV7V6. If the total number of vertices is odd, LabVIEW ignores the last vertex.

Polygon

Draws a single, filled polygon to connect all the vertices, starting at V0 and ending at Five n – 1, where n is the total number of vertices. The total number of vertices must be at least 3, or LabVIEW does non draw anything. Also, the polygon cannot intersect itself.

Vertex Array

The vertex array of a mesh defines the locations of each of the vertices in the mesh. Each chemical element of the array represents one vertex in the mesh. LabVIEW indexes the array co-ordinate to the values you specify in the Indices array. The vertex array is an array of clusters, where each cluster contains the x, y, and z values that ascertain the position of one vertex in 3D space.

Indices

Indices is an assortment of integers that define how LabVIEW indexes the diverse arrays that create the mesh. For example, if the element at position 3 of the indices array is 0, then the elements at position three of the color array, vertex array, normal array, and texture coordinate assortment are all indexed to 0. Apply the indices assortment to change the appearance of the mesh by changing the indices of the elements of iv different arrays without changing the social club of the elements in those arrays individually.

Color Binding Mode

The color bounden style you select for a mesh determines the mode in which LabVIEW binds the elements of the color array to the mesh. Y'all can select from the following color bounden modes:

  • Overall—Binds the color at the first index in the color array to all the primitives of the mesh.
  • Per Primitive—Dissimilar colors bind to each primitive in the mesh. The draw mode of the mesh defines the primitives. For example, this method binds the colour at the showtime index in the color array to the beginning primitive defined in the mesh, and so on.
  • Per Vertex—Binds the colors in the color array to the vertices of the mesh co-ordinate to the indices yous define. If you select a describe fashion that renders a solid polygon or polygons, the color at one vertex blends with the color at the side by side vertex as you motility between the 2.
  • Binding Off—No colors bind to the mesh. LabVIEW ignores the colour assortment.

Color Array

The color array of a mesh defines the RGBA color values to apply at each index of the indices assortment. The color binding mode you specify determines how LabVIEW applies the colors in this assortment. The colour array is an array of clusters, where each cluster contains the red, green, blue, and alpha values that define one color.

Normal Binding Mode

The normal binding mode you select determines how LabVIEW binds the elements of the normal array to the mesh. The normal binding way determines how light reflects off the surface of the mesh. You can select from the following normal binding modes:

  • Overall—Binds the normal at the get-go index of the normal array to all the primitives of the mesh.
  • Per Primitive—Dissimilar normals bind to each archaic in the mesh. The Draw Mode of the mesh defines the primitives. For example, this method binds the normal at the first alphabetize of the normal array to the showtime primitive defined in the mesh, and then on.
  • Per Vertex—Binds the normals in the normal array to the vertices of the mesh according to the indices y'all define. Y'all must define a normal for every vertex in the mesh.
  • Binding Off—Turns off normal binding. LabVIEW ignores the normal array.

Normal Array

The normal array of a mesh defines the origin of each normal in the mesh. Each element of the array represents one normal in the mesh. The normal binding mode you specify determines how LabVIEW applies the normals in this array. The normal assortment is an assortment of clusters, where each cluster contains the x, y, and z values that define the origin of one normal.

Texture Coordinate Assortment

The texture coordinate array of a mesh defines how a texture maps to the surface of the mesh. Each element of the array represents ane texture coordinate. You must define a texture coordinate for each vertex of the mesh. The texture coordinate array is an array of clusters, where each cluster contains the s and t values that ascertain one coordinate in the texture. If you practice not enable texturing, LabVIEW ignores this array. Use the SceneObject property Specials:Texturing to enable texturing on an object in a 3D scene.

Refer to the Using Meshes VI in the labview\examples\Graphics and Sound\3D Moving picture Command directory for examples of how changing the attributes of a mesh affects the appearance of the mesh.

spenceofore1997.blogspot.com

Source: https://zone.ni.com/reference/en-XX/help/372614J-01/lvconcepts/3d_meshes/

0 Response to "drawing 3d objects with vertices"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel