Hi all when i run simulation in my simulink model whit vrml scene, I have a certain position of my vrml scene, when run a new simulation I need that the vrml scene have initial position as the the final position of last simulation but this does not happen. Anyone have a suggestion to resolve this? thanks
Prashant Kumar answered .
2025-11-20
% extract model name model_name = bdroot(gcs); % Here we assume that you have the VR Sink block under its original name in % the model % get the handle to the virtual world associated with the VR Sink wh = vrworld(get_param([model_name '/VR Sink'], 'WorldFileName')); % save the current status of the virtual world to the file associated % with the VR Sink save(wh, get(wh,'FileName'));
Of course, in order to preserve the initial status of your scene, you should backup your original VRML file and arrange copying it to your working scene, when you want to start the simulation with initial status.