[vertices,faces] = targetMeshes(ac)
returns the mesh vertices and faces of all actors in a driving scenario relative to the
specified actor, ac. When displaying meshes by using a birdsEyePlot object, you can use the output
mesh information as inputs to the plotMesh
function.
[vertices,faces,colors] = targetMeshes(ac)
also returns the color of the mesh faces for each actor.
Add a pedestrian and a vehicle to the scenario. Specify the mesh dimensions of the actors using prebuilt meshes.
Specify the pedestrian mesh as a driving.scenario.pedestrianMesh object.
Specify the vehicle mesh as a driving.scenario.carMesh object.
p = actor(scenario,'ClassID',4, ...'Length',0.2,'Width',0.4, ...'Height',1.7,'Mesh',driving.scenario.pedestrianMesh);
v = vehicle(scenario,'ClassID',1, ...'Mesh',driving.scenario.carMesh);
Add trajectories for the pedestrian and vehicle.
Specify for the pedestrian to cross the road at 1 meter per second.
Specify for the vehicle to follow the road at 10 meters per second.
Actor belonging to a drivingScenario object, specified as an
Actor or Vehicle object. To create these objects, use the
actor and vehicle functions, respectively.
Color of the mesh faces for each actor, returned as an N-by-3
matrix of RGB triplets. N is the number of actors and is equal to the
number of elements in vertices and
faces.
The ith row of colors is the RGB color value
of the faces in the ith element of faces. The
function applies the same color to all mesh faces of an actor.
An RGB triplet is a three-element row vector whose elements specify the intensities
of the red, green, and blue components of the color. The intensities must be in the
range [0, 1]. For example, [0.4 0.6 0.7].
In driving scenarios, a mesh is a triangle-based 3-D
representation of an object. Mesh representations of objects are
more detailed than the default cuboid (box-shaped) representations
of objects. Meshes are useful for generating synthetic point cloud
data from a driving scenario.
This table shows the difference between a cuboid
representation and a mesh representation of a vehicle in a driving
scenario.