comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » 3d graphics
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
3d graphics [message #34170] Sun, 23 February 2003 15:34 Go to next message
Dan Madeira is currently offline  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 #34320 is a reply to message #34170] Thu, 06 March 2003 10:03 Go to previous messageGo to next message
daann is currently offline  daann
Messages: 1
Registered: March 2003
Junior Member
Thanks for the advice, however we have some other issues...

We tried positioning a spotlight in front of the sun, however it
lights the sun unevenly and lights everything behind the sun as well.
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?

Cheers,

Dan Madeira
Re: 3d graphics [message #34416 is a reply to message #34320] Thu, 06 March 2003 13:09 Go to previous message
Rick Towler is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: PV WAve on a Gentoo Linux box
Next Topic: running an idl expression stored in a text string

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:41:17 PDT 2025

Total time taken to generate the page: 0.00501 seconds