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

20 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 Möbiusband – Wikipedia

(2)
see under (f)
see Regelfläche – Wikipedia

3 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.

2 Likes

I will post it later

1 Like

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.

3 Likes

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
//
4 Likes

Thanks for the code. I have it running on Open

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

3 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

2 Likes

@skrrt.exe

New movie…

8 Likes

Great…, my favorite one is the Moebius strip!

1 Like

and another one

4 Likes

Here is another 3D movie I made with processing

It’s a Play-through of a Mondrian Game I made.
It’s a Homage to Mondrian, see Gioco da definire - #11 by Chrisir

The levels Mondrian runs through are similar to his own art work. In each level he has to reach a rotating gate that leads to the next level. It’s a simple cursor steering plus space to jump.

Chrisir

8 Likes

Added a new movie: Water Castle

6 Likes

Added a 3D Tic-Tac-Toe

5 Likes

Do you know the game peg solitaire?

images

Here is a movie of a 3D version of peg solitaire, 3D-Solitaire. It has 7 etages / levels and is playable by mouse. You can change the view with Peasycam. You can save and load games.

5 Likes

3D Editor with 3D cursor and 3 different views

I am willing to share all the Code for the movies, just ask

Chrisir

2 Likes

preliminary for Turtle (Logo) for kids

This is a video that shows a Sketch that is a preliminary for Turtle (Logo) for kids.

Kids learn what the Turtle is and can steer it with the mouse.

Message me when you want to see the code.

(there’s one version with mouse input and one with keyboard input (for steering the mouse))

4 Likes