Clear Filters
Clear Filters

Shadows in 3d simulation

23 views (last 30 days)
Sjoerd Quist
Sjoerd Quist on 7 Mar 2024
Edited: Nishan Nekoo on 3 Jul 2024
Right now I'm making a simulation in which I drop an onion. I want to process the images taken by cameras. However, I am having trouble with shadows because the sun only shines on one side in the simulation environment. Is there a possibility to add a second sun or a second light source? When I check the box 'overide scene wheather' in my 3D scene configuration, my simulation crashes every time and I get a fatal error. I hope someone can help me
This is the error i get when i override the weather scene configuration and run the simulation:
Error:MATLAB System block 'TestopstellingSimulinkV4/Simulation 3D Scene Configuration/Simulation 3D Engine' error occurred when invoking 'resetImpl' method of 'Simulation3DEngine'. The error was thrown from ' 'C:\Program Files\MATLAB\R2023b\toolbox\shared\sim3dblks\sim3dblks\Simulation3DEngine.p' at line 0 'C:\Program Files\MATLAB\R2023b\toolbox\simulink\ui\studio\config\m\+SLStudio\StartPauseContinue.p' at line 0 'C:\Program Files\MATLAB\R2023b\toolbox\simulink\ui\studio\config\m\+SLStudio\ToolBars.p' at line 0'. Caused by: 3D Simulation engine was terminated by the user (error code: 4).

Answers (2)

Sarthak
Sarthak on 18 Apr 2024
Hey Sjoerd,
As per my understanding I think you should be able to add multiple light sources. Maybe using the 'position' argument while creating your light object would help. Please refer to the documentation below:
The error you mentioned is usually driven by improper setup. If this is setup correctly, I would suggest making sure MATLAB is on its latest release.
You can reach out to MathWorks Technical Support if you are still facing this error

Nishan Nekoo
Nishan Nekoo on 3 Jul 2024
Edited: Nishan Nekoo on 3 Jul 2024
Hi Sjoerd,
Starting in R2024a, there is a light actor in Simulink 3D Animation: https://www.mathworks.com/help/sl3d/sim3d.light.html
You can use this to add multiple light sources to your 3D Unreal scene.
Please tell me more about this crash you are seeing. Does it happen everytime you check the override weather scene configuration or is it only when you change certain weather parameters? Is this repeatable each time you open MATLAB?
Nishan

Categories

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

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!