How to use IES files with sim3d.Light
    6 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    kenichi tanaka
 el 8 de Ag. de 2024
  
    
    
    
    
    Comentada: Nishan Nekoo
    
 el 13 de Nov. de 2024
            I am trying to visualize the light distribution of an IES file using Simulink 3D Animation.
I created an object with sim3d.Light and specified the IES file in the IESFilePath property, but the light distribution displayed is that of a PointLight instead of the one defined in the IES file. 
How can I ensure that the contents of the IES file are applied?
Below is the code comparing PointLight and SpotLight:
% Code to compare PointLight, SpotLight, and IES light distribution
% The lights illuminate the road surface from the left lane with PointLight, SpotLight, and IES (grid pattern).
% The sun altitude cannot be changed, so it is displayed during the day, but the lights are bright enough to be visible.
world = sim3d.World('Scene',"Straight road");
light1 = sim3d.Light(ActorName='Light1',Translation=[0,-6,1],Rotation=[0,0,0],LightType='PointLight');
light2 = sim3d.Light(ActorName='Light2',Translation=[0,-2,1],Rotation=[0,-pi/4,0],LightType='SpotLight');
light3 = sim3d.Light(ActorName='Light3',Translation=[0,2,1],Rotation=[0,0,0]);
light3.IESFilePath = "TestImg.IES";
world.add(light1);
world.add(light2);
world.add(light3);
viewport = createViewport(world);
viewport.Translation = [-3,-2,4.5];
viewport.Rotation = [0,-pi/4,0];
run(world,0.01,3)
delete(world);
I have attached the IES file used and a PNG showing the light distribution from this file.
The IES file is compressed in a zip archive as it cannot be uploaded directly.
2 comentarios
  Abhinav Aravindan
      
 el 13 de Ag. de 2024
				For a better understanding of the problem, please provide the IES file you are using.
Respuesta aceptada
  Nishan Nekoo
    
 el 6 de Nov. de 2024
        Hi Tanaka-san,
It seems like the IES file is not getting imported because of path issues. IESFilePath requires a full system path.
Using the following line should resolve the issue:
>> light3.IESFilePath = fullfile(pwd, "TestImg.IES");
Nishan
7 comentarios
  Nishan Nekoo
    
 el 13 de Nov. de 2024
				Hi Kenichi,
Thank you so much for your valuable feedback. I am glad that you are seeing the issue be resolved in R2024b. However, as you noted, there are two more issues regarding the unusual brightness and the point light still being enabled. I agree that these are both issues and we will investigate them internally. In the meantime, I will also look into whether any workarounds are available and get back to you.
Nishan
Más respuestas (0)
Ver también
Categorías
				Más información sobre Communications Toolbox en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




