Scalability Simulink 3D animation

2 views (last 30 days)
I'm currently visualizing a light show with about 300 LEDs using the Simulink 3D animation package and it seems I have to handle every LED separately.
In the VR Sink, I have to enable the emissiveColor of each LED seperately and connect each LED to a separate signal in Simulink. If I now want to change the diffusive color of all my LEDs, does that mean I have to change it by hand for each of the 300 LEDs I have?!
Any help is much appreciated.
  1 Comment
Luuk Poort
Luuk Poort on 24 May 2017
I've found a way to change all diffusive colors by opening the vmrl file as text and using 'replace all'. Still this is not a very clean solution and will only work in this particular case.

Sign in to comment.

Accepted Answer

Sebastian Kammer
Sebastian Kammer on 26 May 2017
Hi Luuk,
I am afraid I do not completely understand the issue you are facing. I will try to suggest some ideas to the best of my understanding.
You mention 300 LED objects in virtual world. Are these all identical or do they have separate properties? As far as I understand, you would like these LEDs to share some properties such as color.
If your VR Sink block has a port for the color of each LED, and you want to control the color of multiple LEDs, you could simply connect the ports to a single block (such as a Constant block that specifies a color). It is possible to branch out Simulink signals such that the output of one block is connected to multiple different inputs of other blocks. Then you could simply change the value in that constant block (or even assign it a Workspace parameter) to change the color of multiple LEDs in your model.
If you would not like to deal with a separate VR Sink input port for each LED, maybe you could try to construct your virtual world model so that the LEDs share some parameters. You might be able to do this in the 3D World Editor by using copy-paste by reference. You could copy-paste the "color" node by reference, so that the color of all LEDs in your model would refer to one, which you could then control with a one Simulink signal.
I hope this helps.
Luuk Poort
Luuk Poort on 29 May 2017
Hello Sebastian,
Sorry for the late response.
For as far as I know, the only way to change the "Fields Written" is by manual selection via 'Open' -> 'Simulation' -> 'Block Parameters' -> 'Virtual World Tree'. I would like to be able to select the fields written more easily, by making it an input or inserting a list of all Field names. Say next time I have a thousand LEDs, I do not want to have to check a thousand check boxes in the Virtual World Tree.
I'm new to masks and I do not quite understand how to make such a "LED block".
But, by looking at masks I have found that via right-click VR Sink -> 'Mask' -> 'Mask parameters' a list of all written fields does exist. This means I can generate a large list to assign all desired fields instead of manual selecting.
Thanks a lot for your effort and patience!
All the best, Luuk

Sign in to comment.

More Answers (0)


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

Community Treasure Hunt

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

Start Hunting!