How to make 3D simulation viewer follower actor?

7 views (last 30 days)
Mats
Mats about 22 hours ago
Answered: Nishan Nekoo about 19 hours ago
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.

Answers (1)

Nishan Nekoo
Nishan Nekoo about 5 hours ago
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 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

Categories

Find more on View and Analyze Simulation Results in Help Center and File Exchange

Products


Release

R2025b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!