Solar system simulation

  • Follow


Hey all,

I am working on a solar system simulation for a graphics course, but I'm
having some trouble with the lighting.  I would prefer to have the sun as 
the
central light source (only makes sense) and have everything else be 
illuminated
by it.  Can this be done in a reasonable amount of time or is there a 
lighting trick
I could implement?  Any help would be greatly appreciated.  Thanks.

Matt 


0
Reply mamyot (1) 5/14/2005 4:27:30 AM

killer wrote:

> Hey all,
> 
> I am working on a solar system simulation for a graphics
> course, but I'm
> having some trouble with the lighting.  I would prefer to have
> the sun as the
> central light source (only makes sense) and have everything
> else be illuminated
> by it.  Can this be done in a reasonable amount of time or is
> there a lighting trick
> I could implement?  Any help would be greatly appreciated. 
> Thanks.

The sun is nearly a point light source (not really with about 30"
visible diameter seen from earth). The most tricky part is
setting the parameters in a way that value clamping won't break
lighting.

To render the planets with a directional light source, and for
each planet you set the direction to the normalized vector from
the sun to the planet, which allowes a fire control of the
lighting.

Wolfgang Draxinger
-- 

0
Reply Wolfgang 5/14/2005 9:32:52 AM


In article <118avimt5r603c0@corp.supernews.com>,
 "killer" <mamyot@atlanticbb.net> wrote:

>I am working on a solar system simulation for a graphics course, but I'm
>having some trouble with the lighting.  I would prefer to have the sun as 
>the central light source (only makes sense) and have everything else be 
>illuminated by it.

Trouble is, real outer space is 99.9999% pitch black, punctuated with 
occasional flashes of dazzling brightness. That's why photographs taken 
to show any part of the Earth or Moon or such never show any stars--no 
imaging device has enough dynamic range to image both at the same time. 
You're not going to simulate that on your PC monitor.

My suggestion is, add some ambient light so the dark sides of your 
planets are not pitch-black.
0
Reply Lawrence 5/14/2005 9:36:53 AM

killer wrote:

> Hey all,
> 
> I am working on a solar system simulation for a graphics
> course, but I'm

BTW: Have a look on celestia <http://www.shatters.net/celestia/>
*G*

Wolfgang Draxinger
-- 

0
Reply Wolfgang 5/14/2005 9:52:28 AM

killer wrote:
> Hey all,
> 
> I am working on a solar system simulation for a graphics course, but I'm
> having some trouble with the lighting.  I would prefer to have the sun as 
> the
> central light source (only makes sense) and have everything else be 
> illuminated
> by it.  Can this be done in a reasonable amount of time
> 

Yes, it's easy. Set up a light with glLight()
then for each vertex you send to OpenGL you
send a surface normal as well. Surface normals
are easy to compute for spheres.



-- 
<\___/>
/ O O \
\_____/  FTB.    For email, remove my socks.
0
Reply fungus 5/14/2005 10:33:59 AM

In article <57tgl2-brc.ln1@darkstargames.dnsalias.net>,
 Wolfgang Draxinger <wdraxinger@darkstargames.de> wrote:

>The most tricky part is setting the parameters in a way that
>value clamping won't break lighting.

To me there's another problem, and that is managing the scale of it all. 
For instance, the radius of the orbit of Pluto is about 6 billion km, 
while its planetary radius is only about 1200 km--that's a ratio of over 
6 orders of magnitude. You couldn't render all the objects to scale as a 
single GL scene--most of them would simply disappear in the rounding 
error, assuming GL does single-precision floating point.
0
Reply Lawrence 5/14/2005 10:59:59 AM

Lawrence D'Oliveiro wrote:

> scene--most of them would simply disappear in the rounding
> error, assuming GL does single-precision floating point.

Given the fact, that most of the objects are not visible over
long distances w/o telescopes anyway, that's not a real problem.
I would concern more about the depth buffer. However most
celestial objects are convex, so you can safely disable depth
testing, do a back to front sorting and use glCullFace(GL_BACK);
to render only the visible parts of the objects. Use LOD and
replace actual geometry by billboards over large distances.

Wolfgang Draxinger
-- 

0
Reply Wolfgang 5/14/2005 3:34:56 PM

Wolfgang Draxinger wrote:
> I would concern more about the depth buffer. However most
> celestial objects are convex, so you can safely disable depth
> testing, do a back to front sorting and use glCullFace(GL_BACK);
> to render only the visible parts of the objects. Use LOD and
> replace actual geometry by billboards over large distances.
> 

Ummm...but they're so far apart that the depth
buffer should work perfectly, no sort needed.



-- 
<\___/>
/ O O \
\_____/  FTB.    For email, remove my socks.
0
Reply fungus 5/14/2005 4:59:04 PM

Thanks for all your input everybody; I will try the techniques
you have described.  I should be good to go once I get
the lighting down.  BTW, thanks Wolfgang for the link --
Celestia is an awesome simulation.

Regards,

Matt


0
Reply killer 5/14/2005 5:52:35 PM

In article <t7qhe.44775$US.26035@news.ono.com>,
 fungus <openglMY@SOCKSartlum.com> wrote:

>Wolfgang Draxinger wrote:
>> I would concern more about the depth buffer. However most
>> celestial objects are convex, so you can safely disable depth
>> testing, do a back to front sorting and use glCullFace(GL_BACK);
>> to render only the visible parts of the objects. Use LOD and
>> replace actual geometry by billboards over large distances.
>
>Ummm...but they're so far apart that the depth
>buffer should work perfectly, no sort needed.

The objects are individually far apart, but their front and back faces 
are not.
0
Reply Lawrence 5/15/2005 12:36:34 AM

Lawrence D�Oliveiro wrote:
>>
>>   they're so far apart that the depth
>>buffer should work perfectly, no sort needed.
> 
> 
> The objects are individually far apart, but their front and back faces 
> are not.

Yes but the back faces are culled...



-- 
<\___/>
/ O O \
\_____/  FTB.    For email, remove my socks.
0
Reply fungus 5/15/2005 4:03:15 AM

In article <8Szhe.45060$US.42510@news.ono.com>,
 fungus <openglMY@SOCKSartlum.com> wrote:

>Lawrence D�Oliveiro wrote:
>>>
>>>   they're so far apart that the depth
>>>buffer should work perfectly, no sort needed.
>> 
>> 
>> The objects are individually far apart, but their front and back faces 
>> are not.
>
>Yes but the back faces are culled...

Actually, thinking about it, the most sensible thing to do would be to 
impose your own object clipping. Basically, anything that's so small 
it'll render to some too-small fraction of a pixel can be omitted from 
the scene for the current view.

Did I hear someone say "Pale Blue Dot" ... ? :)
0
Reply Lawrence 5/15/2005 5:59:31 AM

Wolfgang Draxinger wrote:
> Lawrence D'Oliveiro wrote:
> 
> 
>>scene--most of them would simply disappear in the rounding
>>error, assuming GL does single-precision floating point.
> 
> 
> Given the fact, that most of the objects are not visible over
> long distances w/o telescopes anyway, that's not a real problem.
> I would concern more about the depth buffer. However most
> celestial objects are convex, so you can safely disable depth
> testing, do a back to front sorting and use glCullFace(GL_BACK);
> to render only the visible parts of the objects. Use LOD and
> replace actual geometry by billboards over large distances.
> 
> Wolfgang Draxinger

Are you implying that he should render the objects to scale?  That would 
be absolutely ludicrous IMHO.  A to-scale rendering of the solar system 
would be virtually useless.

-Tim
0
Reply Tim 5/16/2005 3:15:41 PM

Tim wrote:

> Are you implying that he should render the objects to scale? 
> That would
> be absolutely ludicrous IMHO.  A to-scale rendering of the
> solar system would be virtually useless.

So? Have a look at celestia and reconsider your opinion.

Wolfgang Draxinger
-- 

0
Reply Wolfgang 5/16/2005 10:16:16 PM

13 Replies
249 Views

(page loaded in 0.142 seconds)

Similiar Articles:











7/30/2012 10:15:28 AM


Reply: