A gravitational Eiffel tower outline with massPoint & junction creation tools |
The junction
creation tool links two massPoint
together as if a spring connected them.
These bonds give the whole object a physical coherence under the effect of gravity. The JavaZ junction
creation tool makes it possible to transform a blueprint into a real physical simulation of the drawn object.
The cohesion of the object naturally depends on the number of junctions
used to link the massPoints
together.
Drag and drop any massPoints . Thanks to the ------junctions ------, the whole structure of the tower will move like a coherent physical body with a certain elasticity. | |
toggle the gravity force (off by default) to drop the structure to the ground | |
play and pause the animation loop (on by default) | |
reset or reload the complete graphic |
The junction
creation tool
The junction
tool applies forces in order to preserve the initial distance between two massPoints
whenever they are drifting apart or brought together.
A junction
between 2 massPoints
can be considered as an /\/\/\/\/\/ imaginary spring. When compressed or extended, a proportional stress is applied to it in order to bring back the junction
to its rest state:
Extended junction |
massPoint / \ / \ / \ / \ / junction / \ / \ / \ / \ / massPoint |
Compressed junction |
massPoint ////junction ////massPoint |
junction at rest |
massPoint /\/\/\/\/\/junction /\/\/\/\/\/massPoint |
For this reason, junctions
are based on Hooke’s law, which states that the force (F) needed to extend or compress a spring by some distance (x) scales linearly (stiffness k) with respect to that distance. This is quite easy to code and produces incredibly dynamic and realistic potentially interactive effects.
To get a fairly realistic spring, friction must be applied to massPoints and spring stiffness must be kept between 0.1 and 0.5. With those setting, 2 massPoints
particles can spring to within a certain distance of each other and reach an equilibrium there.