This example is mostly for fun – a periodic series of damped sine waves. Viewed from or near top-down, I think it's a pretty cool effect. Click on 'animate' below the plot to start it going. The calculations are a little heavy, but my Galaxy S3 copes with them moderately well.
Mouse controls: Left-click and drag to rotate; alt (Mac)- or ctrl (Windows)-click-drag or middle-click-drag to pan; scroll or shift-click-drag to zoom. Touch screen controls: one finger to rotate; two-finger scroll to pan; pinch to zoom. Click/tap on the cube icons to snap to a side-on view.
You can see how the plot is constructed in the HTML source:
animate_waves()
) calculates the new z-values for each grid node, calls three_d.change_data()
,
and then calls requestAnimationFrame(animate_waves)
to loop.
params
variable (not best practice!),
and during the initial creation of the surface, it has .data.color
values attached to it. Ordinarily, the whole object would disappear
at the end of the initialisation function. But in this case, params
and its colours remain, and on subsequent calls to
three_d.change_data()
, the automatic checking sees that colours are already set and don't need changing.
Posted 2016-12-22.