Crystal Of Bubble

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

Description of this video.

I made this with Processing programming code and Kdenlive video editor.
I've learned how to draw in 3D with this Processing example code.

Thanks to nice music:
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.

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


Processing code example.

// 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 
*/




No comments :

Post a Comment