Dynamic Tensegrity Views

Java2D-Based Tensegrity Viewer


Last revision: June 13, 2008

This is a Java2D-based interactive viewer for some tensegrity structures with simple hubs from the Synergetics Gallery. Most are tensegrities and from there anyway. In contrast to the non-enhanced version of the viewer based on Java 1.1, this Java2D version displays the interlayer tendons for all of the double-layer tensegrities. It is of course much nicer to look at than the Java 1.1 version.

Usage

The choice box allows a model to be chosen. The three check boxes allow anti-aliasing, two-toned depth shading and color to be turned on and off. On a slow machine, turning off anti-aliasing can improve the responsiveness quite a bit, but of course the picture looks nicer with it on. For a slow machine, you might just turn on anti-aliasing when you've settled on a particular view you want to study for a length of time. I find the depth shading is useful for the large spherical models, but not so useful for the simpler models.

To rotate the figure, press and hold down the left mouse button in the viewing area and move the mouse across the viewing area. The front of the model rotates in the direction the mouse is dragged.

To shift the figure, press and hold down the CTRL key while pressing and holding down the left mouse button in the viewing area and moving the mouse in the desired direction of shift. You can move between the shift and rotation mode simply by pressing (takes you from rotation mode to shift mode) or releasing (takes you from shift mode to rotation mode) the CTRL key while moving the mouse with the left button pressed. It's easy once you get used to it.

The right scrollbar allows a magnification of the figure by up to eight times.

The Viewer

Contact Information

Bob Burkhardt
Tensegrity Solutions
Box 426164
Cambridge, MA 02142-0021
USA

e-mail: bobwb@juno.com

Your comments are welcome. The relevant source code files are TViewJ2D.java, JModelMenu.java, JTwoD.java, Java2DModel.java, Model3D.java, tuple3d.java and matrix3d.java. TViewJ2D.java also contains the class TViewJ2DPgm which allows the viewer to function as a stand-alone Java application program. In this mode, it does the same thing as the applet, but looks for the model data files on the local file system.

The model data files are available in the "models" subdirectory of the directory this file is in. The meaning of each line of text in a data file is determined by the first character on the line. The first character is either "#", "v" (stands for "vertex") or "l" (stands for "line"). Text lines starting with "#" are comments and are ignored. Text lines starting with "v" are coordinate data for the points (a.k.a. vertices). Cartesian x, y and z values are given in floating-point format. Text lines starting with "l" indicate how geometric lines connect the points. The data are three integers. The first two integers are zero-based indexes into the vertex array. The third integer is a "type" value and determines the color of the geometric line. For tensegrities, geometric lines where the type (mod 8) is 1 are struts.

Dynamic Tensegrity Views