addMesh(actor,vertices,normals,faces)
adds a partial mesh defined by vertices, normals,
and faces. The resulting geometric mesh creates a single solid
body.
addMesh(___,tcoords,vcolor)
adds a mesh additionally defined by the texture coordinates tcoords and
the vertex colors vcolor.
vertices — Vertex positions real positive (N,3) vector
Vertex positions, specified as a real positive (N,3)
vector. This vector includes all vertex positions to be used for the mesh
geometry.
Example: vertices = reshape(1: 6, 2, 3)
Data Types: double
actor — Actor class where property is being added sim3d.Actor object
Actor class where mesh is being added, specified as a sim3d.Actor
object.
faces — Faces of actor shape real positive (N,3) vector
Faces of actor shape, specified as a real positive (N,3) vector. This vector defines how each
triangle of the mesh is drawn. Length must be a multiple of 3.
Example: faces = [1: 3; 4 : 6]
Data Types: double
normals — Normal vectors real positive (N,3) vector
Normal vectors for each vertex, specified as a real positive (N,3) vector.
This vector must be the same length as vertices vector.
Example: normals = reshape(7: 12, 2, 3)
Data Types: double
vcolor — Vertex colors real positive (N,3) vector
Vertex colors, specified a real positive (N,3) vector. This vector must be
the same length as vertices vector.
Example: vertexcolor = reshape(25 : 33, 3, 3)
Data Types: double
tcoords — Texture coordinates real positive (N,2) vector
Texture coordinates of each vertex, specified a real positive (N,2) vector. This must be the same length as vertices array.
Example: texturecoord = reshape(21 : 24, 2, 2)
Data Types: double
Version History
Introduced in R2022b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.