Share via


Controlling Time

Sunrise in New York

Today we show a little of the "Time" sample.   It demonstrates how to use the concepts of rendering time and world time.

In any rendering or simulation engine it is important to understand the system's concepts of time.  VE3D uses two time concepts.  The first is "rendering time", which is a time value specified at the beginning of each frame that should be used for all animation that frame.  This value enables synchronization of all animation in the system, and accounts for things like changes in frame rate. The second is "world time", which is the time of day that is used in the system.  Using this value enables everything that depends on time of day to be synchronized.

Both values can also be overridden.  Rendering time can be overridden by replacing the "TimeStep" with a custom step.  This is useful when, for example, recording a movie of an expensive animation.  Smooth animation and framerate can be achieved despite the fact that the animation itself may be too expensive to render in realtime.  Demonstrated in this sample is overriding world time to affect the sun and stars.

Click here to see it in action.

There are two modes to this sample page.  The first simply speeds up time.  The second rapidly changes the day, but not the time of day, so, you will see the position of the sun at 9 am as the seasons change.  Fun things to notice:  the stars move (the constellations are correct, too), the sun moves, shadows move, clouds change color, and there are pretty sunsets and sunrises.  All this goodness is built in to the new version, but you can only get them if you play with time through the managed control.

Get the code

Comments