How to make 3D simulation viewer follower actor?
Ältere Kommentare anzeigen
Hi there,
I am currently working on a simulation where I want to be able to follow a specfic actor with the camera. I.e. I want to have my camera 'locked' on an actor and follow it. I've tried some of the camera blocks, but nothing seems to change the behavior of the camera in the Simulation 3D envoirment. If anyone knows how to do this, it would be much appreciated if that knowledge was shared with me.

(The actor I want the camera to follow)
Thanks in advance.
Antworten (1)
Nishan Nekoo
am 23 Okt. 2025
Bearbeitet: Nishan Nekoo
am 24 Okt. 2025
1 Stimme
Hi Mats,
If you just want to see this actor in the viewer window, the best way to do this would be to select a "Scene View" in the Simulation 3D Scene Configuration block. You can select this actor, which puts the main camera at the actor origin, but then specify a custom translation and rotation offset to get a different view of the actor.

You can also interactively fix a camera to an actor by hovering over the actor in the Simulation 3D Viewer and pressing 'O' during a simulation.
More information on navigating the 3D environment here: https://www.mathworks.com/help/sl3d/navigate-in-3d-environment.html
Adding a Simulation 3D Camera or Simulation 3D Camera Get does not interact the view of the main window, it just adds an additional sensor to the 3D environment and you can view the output of the camera by connecting it to a Video Viewer.
Hope that helps, and please feel free to ask any follow-up questions!
Nishan
2 Kommentare
Mats
am 27 Okt. 2025
Nishan Nekoo
am 27 Okt. 2025
Great, please reach out if you have any additional questions!
Kategorien
Mehr zu View and Analyze Simulation Results finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!