Clock - The key to Animated VM
For instance,to visualize a variable named speed, people would find that connecting the variable to any static 3D properties is awkward. The concept of speed, on the other hand, can be better visualized by animated visualization, such as a cube spinning by speed’s value. This is the example for generate the spinning cube in DIVA.
Open the ubvm.java in Example/Java folder,insert a breakpiont in line18. Here we use the variable fvar to be the speed argument.
Now , visualize fvar ,it will pop up the mapping dialog.
First, we want the cube spins 10 degrees per 2 second. So we need math node to calculate the time interval. Click the math mapping node in math category.
And enter the arithmetric of the math node.
Second , click the clock mapping node in auxilary category. This mapping node has four port , there are low、 High、Increment、Time interval. Low port is the lowerbound of the variation., and high port is the upperbound of the variation. The variation interval is increment. The time interval is control the variation time.You can edit the port value as same as VM attribute.
In default , the ports in order is 1、NULL、10、0.5. For this example , please modify the port value like this.
Now this clock mapping node will change the value from 0 to 360 , increase 10 per 2 seconds. And we connect the outport of clock mapping node to the yaw port of a cube UBVM , it means this cube will yaw 10 degrees per 2 seconds. Connect both of them like this.
And you will see a cube is spinning on the window!