Non-time based transitions

Moohasha

20-03-2009 17:06:26

I just downloaded Caelum and built the demo and it looks great. I want to use it in a simulation I'm making, but I don't want the transition from night to day to be based on time, I want it to be based on altitude. Basically, I want to see the night sky when I'm really high up, the noon sky when I'm close to the ground, and a nice transition when between the two. Anyone know how this would be possible?

stealth977

20-03-2009 18:15:55

I just downloaded Caelum and built the demo and it looks great. I want to use it in a simulation I'm making, but I don't want the transition from night to day to be based on time, I want it to be based on altitude. Basically, I want to see the night sky when I'm really high up, the noon sky when I'm close to the ground, and a nice transition when between the two. Anyone know how this would be possible?

Interpolate time depending on altitude? you can set time whatever you like, so when the camera moves and altitude changes, just change the time...

Moohasha

20-03-2009 18:17:55

I thought about doing that, but time also moves things like the clouds and sun. When moving down toward the ground I don't want it to look like time suddenly shot forward, I want it to look like you're moving from space to the ground. If that makes sense.

stealth977

21-03-2009 08:54:54

I tested it with Ogitor, setting time does not move clouds :) Clouds are moved by the update() depending on the timescale but not the time itself

ismail,

cdleonard

23-03-2009 12:30:19

The night/day appearance of the sky is completely controlled by the position of the sun. There's no pretty way to do what you want; you basically want to override the sun's motion.

You can do that by changing stuff inside Caelum's components sometime after _updateSubcomponents. You can do something like mCaelumSystem->getSkyDome()->setSunDirection(/* Something based on altitude */); All of caelum's updates are done inside _updateSubcomponents; you can override all parameters by changing stuff after that call. If it doesn't work then it's a bug.

Perhaps it would be nice to have something like setAutoSunDirection(false); setManualSunDirection(/*Something based on altitude*/). That way you could avoid bothering with update timing; but it would make the logic in _updateSubcomponents big and hairy.