Animations and CindyLab


Animations and CindyLab

Many devices in the real world are driven by some kind of motor. On an abstract level, a motor pumps energy into the system. It causes movement that goes beyond the pure interaction of free mass-objects. There are three principles in CindyLab that allow for the external actuation and control of a simulated environment.

  • Actuation of springs
  • Use of a geometric Cinderella Animation
  • Use of a CindyScript script to change parameters (such as positions and velocities) of the system

In what follows we shall briefly sketch these three possibilities. Since the number of possible interaction scenarios is practically infinite, we shall again focus only on the basic principles and give a few illustrative examples.

Spring Actuation

Spring actuation is perhaps the most intrinsic way to drive a CindyLab simulation. It is discussed in the context of Springs. It can be used to vary the resting length of a spring periodically. If the environment also supplies some friction, then one can use spring actuation to obtain points that exhibit periodic motion. As explained in the Spring section, one can alter the amplitude and the phase of the actuation independently. The picture below shows several springs all actuated with identical amplitudes but with differing phases.

Many actuated springs: same amplitude, different phases

A typical application of actuated springs is the generation of legs for small walking devices, whereby one connects a point to several springs that are actuated with a particular phase shift. In the figure below, the two springs of each leg are actuated with a phase shift of 0.25. Each leg has a phase shift with respect to the other. This results in a cyclic walking behavior of the four legs.

Walking legs

If this device is dropped onto a CindyLab Floor, it automatically starts to walk like a little animal.

A walker taking a stroll across the floor

Geometric Animations

In the geometry part of Cinderella there is a standard way of animating points through the use of Animation mode. In this way, one can, for example, create rotating points on a circle or moving points on a segment. The animation mode of Cinderella works seamlessly with CindyLab. One can use animated points and equip them with physical properties or connect them to springs. In the picture below a kind of long elastic rope was created by connecting several rubber bands. One end of the elastic was fixed to the green point at the far left. The other end is driven by a Cinderella animation. The rotating point on the circle is used to move the end of the elastic up and down in periodic motion.

Animation of an oscillating wave

Mass-objects can also be used directly in animations. The following example is physically quite unrealistic, but it demonstrates a possible use of mass-objects in animations. Here a Sun is bound to a circle. An animation causes the sun to revolve around the circle. The picture shows the trace of a red planet under the attraction of a rotating yellow sun.

A planet revolving about a revolving sun

Animations are synchronized with the physics simulation. This means that if one moves the animation speed slider, then both the physics simulation and the animation itself become slower.

Driving Simulations with CindyScript

As usual, CindyScript provides the most flexible and powerful way of influencing a simulation. With CindyScript one can directly influence the parameters of CindyLab objects such as position, velocity, and restlength. In this way, whenever the CindyScript code is executed, one can influence the behavior of the physics objects. As explained in the CindyScript manual, this scripting language allows execution to take place at a specific time. A detailed list can be found in the CindyLab and CindyScript section.

In principle, CindyScript can alter any physics behavior, since it has the "final word" on the parameters of the object. For instance, one can alter the speed of a particle programmatically. The following example shows a simple control loop for balancing a spring by moving one of its points.

The balancing seal before start
The balancing seal at work

The tip of the nose of the seal is point C. The other endpoint of the spring is point D. The following lines of CindyScript code perform the balancing by changing the horizontal velocity of point C.

if(C.x < D.x,C.vx=C.vx+.05);
if(C.x > D.x,C.vx=C.vx-.05);

The first line says that whenever the spring tends to fall to the left, the seal has to accelerate in this direction to prevent the spring from falling. The second line says exactly the same for the other direction. Finally, the last line adds a small degree of randomness to the movement of the seal. This makes the animation appear much more realistic.

Sometimes it is useful to perform CindyScript actions at specific moments of time. For this there are two different concepts of time within CindyScript. There is a function simulationtime() that is synchronized with the internal time of a simulation. Every time step of the simulation increases this value. Alternatively, one can refer to a timer that is synchronized with real time. For this, the CindyScript functions time() and seconds() are useful. For details on this concept please refer to the section Time on the page Special Operators.

Contributors to this page: Richter , Kohler , Akira Iritani and Kramer .
Page last modified on Saturday 30 of July, 2011 [23:38:38 UTC] by Richter.

The content on this page is licensed under the terms of the License.

free viagra samplehentai girlsmature pussymilfseeker cialis samplescam clip movie nude webcammother incest order viagra online cialis ukanime rapeparis hilton phone numbers viagra alternatives cialis forum cialis free samplehot girls in pantiesmonster of cocks discount cialis cilias free viagra samplesfree chat rooms cilia structurefree cartoon sex comics buy cialis order viagrafree adult videosplump girl gallerypantyhose gallerycum on her face cheapest cialisbisexual moviestampa bukakehuge black cock thumbnails buy cialis onlineporn star cialis drugwomen having sex cheap generic viagra alternative to viagra natural viagra cheap viagraoral sexteen webcam strip videosnude spanish girlserotic sex cams movies viagra side effectscartoon adultdisney sex animenude blonde hairygang bang swinger cialis viagrabisexual free moviesgay twinkswebcam chat live xxxyoung teens order cialislatina girls thongscum loversjapanese girl viagra cheapyoung japanese girlsmr chews asian beavergangbang squadshoshone indiansmature wiveslive webcam chat girlsfree ebony viagra on lineasian ladyboysteen boys viagra pillsself bondage techniques cailisincest familyfree ebony cheap cialisgay amateur cialis genericbusty asian viagra onlinemature breasts viagra for women free viagrabig boobies cialis generic viagragloryhole gaylatinas in thongs female viagraindian tits viagra 6 free samplesamateur upskirt viagra alternativefree xxx video cialis online discountgalleries of teen girls cialis dosage cheap generic cialisparis hilton pornopussy cat dollsbrutal sexgay peopleblack milfsno tits discount viagrablonde hairy pussyshemale animefree hardcore moviesmom strips for sonfat titscelebrity legsdouble anal levitra vs cialis cialis tadalafil cialis cheapgay bdsmcelebrities exposed viagra generic alternatives to viagra viagra canadabestialitypink porn stars viagra jokesclips of teen sexchicks suck horse cock online viagrasex with horsespainful analglory holes floridafree american bukkake cialis online buy viagrabig cock cum free cialisteen gay porn cialis side effects herbal viagra best price viagra purchase cialis cialis soft tabs cialis vs viagrafree fat girl webcamfree porn movie clipsoral penis suckingebony hardcore viagra pricepantyhose crossed legs cialis and levitralesbiennesblonde boobs buy viagra online