Lighting the Solar System - Omnidirectional light source (Sun)

조회 수: 2 (최근 30일)
Craig
Craig 2013년 4월 14일
I am creating a model of the Solar system and am trying to create a light source that appears like it is coming from the Sun. I have a spherical surface centered around the origin but when I place a light source within it the light of course cannot escape the spheres interior. I have tried altering the spheres transparency and surface properties with no luck, I am by no means an expert in lighting and surfaces so if anybody has experience I would greatly appreciate it!
  댓글 수: 2
Image Analyst
Image Analyst 2013년 4월 14일
You haven't given us enough information about your model to answer this. Is this MATLAB, or a Simulink Model? You didn't list Simulink so I assume MATLAB. So if it's a MATLAB model, then you'd need to tell us what equations you're using, and what in the equation indicates whether light should be blocked or passed at the radius of your sphere.
Craig
Craig 2013년 4월 14일
편집: Craig 2013년 4월 15일
Apologies, it is a MATLAB model, not Simulink. The code used to generate the sun is a simple sphere & surf with an image applied.
I have tried to edit things like: AlphaData, AmbientStrength and DiffuseStrength but these do not seem to effect how the sphere actually passes light only how it reflects it on the exterior. What I'm looking to know how to do is how to pass light at the radius of this surface like you mentioned.
Overall this is how my model looks so far, I only need to model these two planets but I would like to get the lighting in if possible: https://www.dropbox.com/s/gmhyic1z6b2pyvg/Sol.jpg

댓글을 달려면 로그인하십시오.

답변 (1개)

Ahmed A. Selman
Ahmed A. Selman 2013년 4월 14일
I don't know really if Matlab is used for such tasks, but haven't you tried Simulink for easier handling of the problem? Such graphic tasks are made easy using the virtual reality modeling language (VRML). There is a reference model that comes with Simulink in
vrplanets.mdl
which exactly uses the idea you mentioned, and can be easily edited to include the texture of the sun as the image you posted. The rest, particularly the lighting of the planets, is all pre-set.
  댓글 수: 1
Craig
Craig 2013년 4월 14일
Thank you for your answer but the conditions set out by my module coordinator only allow me to submit m-files as part of my problem solution.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by