Crystal of Bubbles: Exploring 3D Generative Art in Processing

3D animation with Processing programming code.
Processing code makes this 3D animation.

 

Behind the Animation

This work was created during my early experimentation with 3D animation. Using Processing for the generative visuals and Kdenlive for video editing, I explored how simple algorithmic rules could evolve into complex, ethereal structures.

Through this project, I learned the intricacies of 3D rendering—specifically how to use 3D noise to drive the motion and opacity of spheres within a coordinate system.

Music Credit:
"Eastern Wind" by Unheard Music Concepts
2016/11/01
http://freemusicarchive.org/music/Unheard_Music_Concepts/Industry/09_Eastern_Wind
Eastern Wind by Unheard Music Concepts is licensed under a Attribution License.
Based on a work at www.unheardmusicconcepts.com
Permissions beyond the scope of this license may be available at www.unheardmusicconcepts.com or contact artist via email.

クリエイティブ・コモンズ・ライセンス

 

The Source Code

Here is the original Java code for Processing. It uses a 3D noise field to determine the transparency of each sphere, creating the "crystal" effect.

// Crystal Of Bubble
// Processing 3.2.1
// 2017.01.31

import processing.opengl.*;

float xstart, xnoise, ystart, ynoise, zstart, znoise;

int boxsize = 540;
int spacing = 60;
float divnoise = 0.008;
float divmove = 0.005;

void setup() {
  size(1280, 720, OPENGL);
  noStroke();
  sphereDetail(30);
  background(20);
  frameRate(30);
  
  xstart = random(10);
  ystart = random(10);
  zstart = random(10);
  
}

void draw() {
  background(20);
  
  xstart += divmove;
  ystart += divmove;
  zstart += divmove;
  
  xnoise = xstart;
  ynoise = ystart;
  znoise = zstart;

  float cicle_rotate = (frameCount % 3601) / 10.00 ; cicle_rotate = sin(radians(cicle_rotate));

  float center_x = (width / 2) * (1.0 + cicle_rotate / 9);
  float center_y = (height / 2) * (1.0 + cicle_rotate / 5);
  float center_z = boxsize * (0.6 + cicle_rotate / 2.5);

  translate(center_x, center_y, center_z);
  rotateX(frameCount * divmove / 40);
  rotateY(frameCount * divmove / 46);
  rotateZ(frameCount * divmove / 4);

  int boxcenter = boxsize / 2;
  for (int z = -boxcenter; z <= boxcenter; z += spacing) {
    znoise += divnoise;
    ynoise = ystart;
    for (int y = -boxcenter; y <= boxcenter; y += spacing) {
      ynoise += divnoise;
      xnoise = xstart;
      for (int x = -boxcenter; x <= boxcenter; x += spacing) {
        xnoise += divnoise;
        drawPoint(x, y, z, noise(xnoise, ynoise, znoise));
      }
    }
  }
  /*
          saveFrame("frames/####.png");
          if (frameCount >= 3000) {
            exit();
          }
  */
}

void drawPoint(float x, float y, float z, float noise3d) {
  pushMatrix();
  translate(x, y, z);
  float alph = 2 + (noise3d * 100);
  fill(200, alph);
  sphere(spacing / 2.1);
  popMatrix();
}

/*
Copyright (C) 2017- deconbatch

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>
*/


 

Next Post Previous Post
No Comment
Add Comment
comment url