planet_system

add video picture

Planet System

This is a visualization of our solar system. It is designed with children as the target audience. Besides showing planets orbiting the sun it also displays some text explaining unique characteristics of each planet.

To make it interactive Arduino is used. Two analogue inputs are connected to the board. The input signals are sent to VVVV. Two enable the planet description whilst the other selects which description to display.

The final product

Here you will learn how to make your own Planet System. Good Luck :)

Mechanism

There are five components to this patch.

  1. The sun
  2. The planets
  3. Planet descriptions
  4. A line pointing to the planets
  5. Planet orbits
The Sun

A sphere node is used to represent the sun.A Transform node is applied to define the coordinates and the size by manipulating the Translate and Scale properties.If the sun appears to be pixelated, the value of Resolution X and Y are increased. The value should not be too big, as this affects performance. Using FileTexture you can style picture of Sun.

The Planet

Three nodes play a key role here: LFO, CircularSpread and Transform.The LFO node acts as a motor which runs from 0 to 1 continuously. This is connected to the CircularSpread, which is then passed onto the Transform node. This allows a circular motion to be created. The Period input of the LFO can define how long it takes fora single orbit around the sun. If a value is multiplied with the CircularSpread X and Y, the distance from the Center can be defined. This will come in handy to display multiple planets.FileTexture node for upload the pictures where you can add your own planets.

Planet Description

The planet description are made by using the Text node. The node can be placed accordingly and also scaled using Transform. The Text Rendering Mode is changed to MultiLineWordWrap to make sure the words fit in the Renderer. The help file shows more about this.

Line to Planet

A line to the planet can be drawn using the Line node. The From input is a fixed 3 slice Value, whereas the To input is a varying 3 slice Value which uses the SetSlice node to set the X and Y of the line. The X and Y are passed on from the CircularSpread, so that the line can point to the center of each planet even though it is moving.

Planet Orbits

There are many ways to display a circle or oval to represent the planet orbits. This patch uses the Segment node connected to a Transform node. If the Width of the Segment is made thin enough, it will appear as a line. The orbit can also be drawn using a Rope node.

Making multiple objects

The steps above show how to make a single object. To make several objects, the SliceCount Mode of an Value input box must be changed from Iput to ColsRowsPages. To those who are familiar to other programming languages, this is basically a way of making Arrays or Fields.

If the Planets Value input box has 5 Rows and 5 different values for Translate X and Translate Y, 5 objects should appear on the Renderer screen. Row 1 always corresponds with Row 1 of another input. This whole concept is applied to make multiple planets, planet descriptions, lines and orbit paths.

To add some flavor to the visualization, a FileTexture node can be connected to the Sun and the Planets. By Right Clicking the top left input button and selecting a picture, the Sun and planet textures can be customized. The textures can also be further Transformed if needed.

Communication with Arduino

The GetSlice node plays a vital role in the interactivity with the user. This node is able to return one slice from a Spread or in other words one value from the array of values. By defining the Index input of a GetSlice node, one Text Slice from the Planet Description and one line can be selected.

Smoothing and Visual Easing

Nodes such as Damper and Delay are used to slowly change the Renderer output to make is more visually pleasing. The Damper node slowly changes an input whereas the Delay node delays the change. Abrupt changes are avoided to make the patch look smoother.

Arduino Code
int potiPin1 = A0;
int potiPin2 = A2;
int potiReading1 = 0;
int potiReading2 = 0;

void setup() {
  Serial.begin(9600);
  pinMode(potiPin1, INPUT);  
  pinMode(potiPin2, INPUT);
}

void loop(){
  
  potiReading1 = analogRead(potiPin1);
  potiReading2 = analogRead(potiPin2);
    
  Serial.print("<poti1>");        //this is when button is pressed
  Serial.print(potiReading1);
  Serial.println("</poti1>");
  
  Serial.print("<poti2>");
  Serial.print(potiReading2);
  Serial.println("</poti2>");

  delay(200); 
}

The circuit layout shown above shows two potentiometers connected to the Arduino analog ports A0 and A2. These can be changed if the code is adjusted. For more information on the Arduino setup please visit the Arduino website.

Arduino Code available here

VVVV_patch available here

planet_system.txt · Zuletzt geändert: 2018/12/03 09:43 (Externe Bearbeitung)