3d graphics [message #34170] |
Sun, 23 February 2003 15:34  |
Dan Madeira
Messages: 2 Registered: February 2003
|
Junior Member |
|
|
Hi all,
I'm doing a undergrad group project where we have to use IDL to code a
sterographic representation of the solar system. However we have no prior
knowledge of this language, and so we are a little bit stuck....
We have drawn four globes representing the Earth, moon, mars and the sun
using the `orb` procedure, and then used a for loop to translate the globes
according to a specified orbit, redrawing the view in both the right view
and left view widgets each time. However this results in a large lag between
each update, which ruins the steroscopic effect. Has anyone got any ideas of
a faster technique?
Also, we would like to have a globe, which is internally lit, representing
the sun. However when we placed a light source inside the orb, its surface
remained unlit though the other objects were properly lit. Is there any
simple way of solving this?
Cheers,
Dan Madeira
|
|
|
|
Re: 3d graphics [message #34416 is a reply to message #34320] |
Thu, 06 March 2003 13:09  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
"Dan Madeira" wrote in message
Welcome to the world of OpenGL lighting...
> We tried positioning a spotlight in front of the sun, however it
> lights the sun unevenly and lights everything behind the sun as well.
Constructing a realistic 3d scene can be very difficult. As you are coming
to realize, lighting only goes so far. If you have played any 3d games
lately you can appreciate the work of the texture artists.
Yes, the spotlight will cast right thru the sun and onto anything beyond it.
That should be O.K. though since the sun does cast light in all directions,
right?
If the lighting is uneven, then place more lights around it. You can either
place a number of fixed lights around the sun or place 2 lights maybe +-15
deg off your view axis.
You will only get so far with lights alone. I would probably brightly light
the scene with an ambient light and use textures for your planets and sun.
The trick will be to create your planet textures so that they have a "dark
side". You'll have much more flexibility with this approach.
Either way has its limits.
> Also, when we placed a light inside the sun, each planet is lit but
> they don't cast shadows. Does anyone have any ideas on how to sort
> this out?
Lighting in OpenGL will not cast shadows. If you want shadows you need to
calculate them yourself and apply them as textures. This is not a trivial
exercise. For a constrained set of conditions you could probably work
something up though.
-Rick
|
|
|