- Create a patch and record its handle. At each time step, update the patch XData and YData and ZData properties.
- Create a patch and record its handle. At each time step, update the Vertices properties
- Create hgtransform group and record its handle. Create a patch and set its parent to be the hgtransform group. At each time step, update the transform matrix of the hgtransform group.
Moving 3D patch object along a trajectory
86 views (last 30 days)
Show older comments
Grant Cole
on 14 Oct 2019
Commented: Grant Cole
on 14 Oct 2019
Hello
I created a 3D object with the patch function. I want to move this object along a trajectory, where the coordinates are functions of time. I want to move the object along the trajectory and show the plot as an animation of the object's motion by generating the path coordinates with a for loop, with time being the variable that changes with each iteration. I want to move the object by adding the coordinates of its original vertices to those of the path, dependent on time. I am not sure how to do this though. Any help would be appreciated. Thank you.
0 Comments
Accepted Answer
Walter Roberson
on 14 Oct 2019
There are three ways of doing this.
The third option would always translate and rotate the patch as a group -- a rigid movement. The second option would encourage keeping the same face connections but would permit the vertices to move comparatively freely within that (e.g., a square could easily become a pentagram.) The first option permits more arbitrary movement of the vertices (but if you add new vertices along the way then you might need to update more properties.)
More Answers (0)
See Also
Categories
Find more on Graphics Performance in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!