Skip to main content

Animation

So far we have seen how we can set the shape and geometry of 3D objects based on IoT parameters. In this example we use the build-in animation capabilities to create a rotating windmill on a 3D map. The direction of the windmill and rotation speed are based on real-time weather parameters.

Rotor

The axis of the rotor is created by a cylinder and a sphere, which are rotated 90 degrees along the X-axis. The blade is created by a cone with a bottom diameter of 2 and a top diameter of 0.5. The cone is scaled to simulate a flat rotor blade and it has a variable rotation defined by parameter angle.

Windmill

The windmill pole is created by a cone and the rotor is attached to the top, together with a box and a flashlight. The rotor is placed inside an animation block which rotates the part along the Y-axis in a number of seconds. The parameter seconds is calculated from the parameter windspeed and the parameter direction is used to rotate the whole part.

Topics

We can now link the rotation speed and orientation of the windmill based on the actual wind speed and wind direction obtained by the integration with OpenWeather.

windmill.wm_01.geometry = Windmill(weather.eindhoven.wind_speed, weather.eindhoven.wind_direction)
windmill.wm_01.position = 51.607268, 4.053661,0

windmill.wm_02.geometry = Windmill(weather.eindhoven.wind_speed, weather.eindhoven.wind_direction)
windmill.wm_02.position = 51.605886, 4.051398,0

Model

The live animation of the windmills in the Cesium environment is created by adding the topics for the three windmills and select the Cesium viewer.