Some Movies I made

Hello,

I made a few movies using processing.

A toast to hamoid and his great lib.

Is somebody is interested in the code, tell me.

Regards, Chrisir

11 Likes

Believe you mentioned something about two different Moebius band/strip formulas on the German Wikipedia a little while back. Did you use a separate one for the red and yellow coloured one?

1 Like

These are great :smile:

1 Like

Did you use a separate one for the red and yellow coloured one?

There are apparently two different kinds of Moebius Strips, this one (1) and the one where you cut a paper strip and glue it back together 180 degree turned (2).

Anyway, both Moebius Strips above are based on the same formula (1). The difference is that one consists of small yellow spheres forming the strip and one has a red quad_strip shape made from their positions.


Here are the formulas:

(1)
The formula I used:
see https://de.wikipedia.org/wiki/Möbiusband#In_der_Mathematik

(2)
see under (f)
see https://de.wikipedia.org/wiki/Regelfläche#Beispiele

2 Likes

Definitely interested in your code, Chrisir, especially your fireworks. They are super realistic! Are you using OpenProcessing? If so, I just need the sketch numbers.

1 Like

I will post it later

Great stuff–thanks for sharing. The Marble track reminded me of great CGI classics like the Mind’s Eye series.

I also enjoyed the small set / stage that you made for rotating some of your pieces.

1 Like

here it is.

  • For saving images to make a movie from, set videoExportIsOn1 to true

Chrisir

ArrayList<Spark> sparks = new ArrayList();
int divider=1;
// ***************************************************************************
boolean videoExportIsOn1 = false;// ******************************************* 
// ***************************************************************************

// -------------------------------------------------------------------------------

void setup() {
  size(1240, 960, P3D);
  noStroke();
  fill(255);
  sphereDetail(5);
}

void draw() {
  background(0);
  lights(); 

  // text 
  fill(255);
  text("Click mouse to start firework. Hold any key for spheres.", 22, 22);

  // manage sparks
  if (keyPressed) {
    noStroke();
  }
  for (Spark Spark : sparks) {
    Spark.move();
    Spark.display();
    Spark.script();
  }

  // remove dead ones 
  for (int i=sparks.size()-1; i>=0; i--) {
    Spark s = sparks.get(i); 
    if (s.isDead) 
      sparks.remove(i);
  }

  // spawn new 
  if (frameCount%divider == 0) {
    mousePressedNew();
    divider=int(random(13, 33));
  }

  // images for movie (menu tools)
  if (videoExportIsOn1) {
    // Saves each frame as line-000001.png, line-000002.png, etc.
    saveFrame("line-######.png");
  }
}

// ---------------------------------------------------------------------------------
// Input 

void mousePressed() {
  int colType=int(random (7));
  for (int i=0; i<1000; i++) {
    Spark spark = new Spark(width/2, height-4, 4);
    sparks.add(spark); 
    spark.jump( mouseX, mouseY, colType);
  }
}

// --------------------------------------------------------------------------
// Tools

void mousePressedNew() {
  int colType=int(random (7));
  float x= random(44, width-44); 
  float y= random(44, height-44);  //     random(33, 220);
  for (int i=0; i<990; i++) {
    Spark spark = new Spark(width/2, height-4, 4);
    sparks.add(spark); 
    spark.jump( x, y, colType );
  }
}

// ================================================================

class Spark {

  float x, y, z; // position 

  float diameter; // Durchmesser 

  float gravity = 0.53; // Gravitation 

  color col;

  final int stateWait=0; 
  final int stateTriggered=1;
  final int stateJump=2;
  int state = stateWait;

  int timer;
  int duration; 

  float angle, radius, radius_Add; 
  float maxRadius=1000;
  float centerX, centerY; 

  boolean isDead=false; 

  // Constructor
  Spark(float x_in, float y_in, 
    float diameter_in) {

    x = x_in;
    y = y_in;

    diameter = diameter_in;
  }// Constructor 

  void move() {

    // Spark move 

    // move 
    x = centerX+cos(angle)*radius;
    y = centerY+sin(angle)*radius;

    radius+=radius_Add; 

    if (radius>maxRadius)
      isDead=true;
  }// function 

  // start spark 
  void jump( float x, float y, int colType ) {
    timer=millis();
    // duration for this spark to start after ignition 
    duration=int(random(0, 90));
    state=stateTriggered;
    centerX=x;
    centerY=y;
    angle=random(0, TWO_PI);
    maxRadius= random(90, 200);
    diameter=random(1.5, 7.7);

    // print(colType); 
    switch (colType) {
    case 0:
      col = color(random(256), random(256), random(256));
      break; 

    case 1:
      col =  color(random(256), 0, 0);
      break; 

    case 2:
      col =  color(random(256));
      break;

    case 3:
      col =  color(random(254, 256));
      break;

    case 4:
      // blue or white 
      if (random(100)>50) 
        col =  color(0, 0, random(254, 256));//blue
      else col =  color(random(254, 256)); // white
      break;

    case 5:
      // A or B 
      if (random(100)>50) 
        col = color(random(50, 256), random(50, 256), random(50, 256));
      else col = color(random(256), random(256), random(256));
      break;

    default:
      col = color(random(33), random(22), random(256));
      break;
    }
  }

  void script() {

    switch(state) {

    case stateWait:
      //
      diameter-=.1; 
      break;

    case stateTriggered:
      if (millis()-timer>duration)
        state=stateJump;
      break;

    case stateJump:
      jump2();
      state=0;
      break;

    default:
      println("Error 114");
      exit();
      break;
    }//switch
  }//method

  void jump2() {
    //starts explosion 
    radius_Add=random(2.1, 9.4);
  }// function 

  void display() {
    // Spark display 

    if (!keyPressed) {
      fill(col);
      ellipse(x, y, diameter, diameter);
    } else {
      pushMatrix();
      translate(x, y, 0);
      fill(col);
      sphere(diameter);
      popMatrix();
    }//else
    //
  }// function 
  //
}//class
//
1 Like

Thanks for the code. I have it running on Open

Processing as https://www.openprocessing.org/sketch/744586.

2 Likes

These. Are. Amazing! I would love to see more of these :slight_smile:

1 Like

I made a github upload of one of the Moebius Strips

Showing also the green stage with the clouds

see https://github.com/Kango/3DSketches/tree/master/Moebius4

@skrrt.exe

New movie…