Three.js – Spinning Planets

After being inspired to do a space themed threeJs final, I learnt how to add in textures, control different functions and modify them to do what I want them to do as well as take something and put my own spin on it.

After deciding that I wanted my main focus to be on Earth and finding that just using the snippets felt like I wasn’t learning code and what threeJs can do, I decided to push it a little further. I did this by adding two meshes, one a jpg and one a png on top of each other to create layers. From there I wanted to have them spin at different speeds to make it clear that they were two different elements. I decided to have Earth spin slower than the clouds but still visible that it is rotating. Having the different meshes rotate at different speeds created a visually appealing loop. 

The next element I wanted to add were some stars which I created using the particles snippet. However, instead of having them spin around screen, I wanted them to stay in one spot and then I wanted them to twinkle. In the particles snippet you can have the particles change colour but I decided that having one colour worked well and then having the particles slightly smaller and then fade in and out of brightness created a nice twinkle effect and that added another layer to the final output and tied the space theme together.

I wanted to add in one more element as it was becoming more obvious that this was based in space with a black background, stars and Earth, I thought that having a moon would also be a cool idea. It took a while to play with the code to get the positioning of the moon correct but once it was it was easy to create the rotation.

A lot of the struggles I had with this program Tim was able to help me with. I struggled with adding two meshes on top of each other but Tim suggested making the cloud layer slightly bigger would fix the problem and it did just that. He also came up with the math code to create the brightening and fading for my stars. Thank you Tim.

You can view it here – //threejsplaygnd.brangerbriz.com/s/?id=8238 and I believe I managed to get the moon working.

Understanding the code –

Below is the code. There are image which has my notes explaining what it does and then my actual code and the images I used.

Code –

<!DOCTYPE html>

<html>

<head>

<meta charset=”utf-8″>

<style>

body {

background-color: #ffffff; 

margin: 0;

overflow: hidden;

}

</style>

</head>

<body>

http://threejsplaygnd.brangerbriz.net/js/three.min.js

http://threejsplaygnd.brangerbriz.net/js/Detector.js

<script>

if ( ! Detector.webgl ) Detector.addGetWebGLMessage();

var camera, scene, renderer; 

var geometry, material, mesh; //the different variables that are used. These also control the differnt aspects so I can do different things with them individually 

var cloud_geometry, cloud_material, cloud_mesh;

var moon_geometry, moon_material, moon_mesh;

function setup() {

var W = window.innerWidth, H = window.innerHeight;

renderer = new THREE.WebGLRenderer();

renderer.setSize( W, H );

document.body.appendChild( renderer.domElement );

camera = new THREE.PerspectiveCamera( 50, W/H, 1, 10000 );

camera.position.z = 500;

scene = new THREE.Scene();

//moon

                map = THREE.ImageUtils.loadTexture(‘https://lh3.googleusercontent.com/proxy/Knq3LMr0rgQKzbVDRM_S-f9jUzEqHN8tOWQU59BJNjoIjfYNeTE4mlaMb3wH1ZuVXQfjMoj_vVUtKenJmodYos-h&#8217;); //this loads the image using the imageURL

moon_geometry = new THREE.SphereGeometry(150, 100, 100); //this controls the size

moon_material = new THREE.MeshBasicMaterial({shading: THREE.FlatShading, color: 0xdcdcdc, map: map}); //this controls the colour, shading, transparency and opacity (if stated) of the shape

moon_mesh = new THREE.Mesh(moon_geometry, moon_material);

map.wrapS = map.wrapT = THREE.RepeatWrapping;

map.repeat.set( 1, 1 );

moon_mesh.scale.x = moon_mesh.scale.y = moon_mesh.scale.z = 0.39; //this controls the size

moon_mesh.position.y = 150.23; //this controls the X and Y locations

                moon_mesh.position.x = 180.23;

scene.add(moon_mesh); //this loads everything

//Clouds

map = THREE.ImageUtils.loadTexture(‘https://upload.wikimedia.org/wikipedia/commons/d/df/Earth-clouds.png&#8217;); //this loads in the image url to use as a texture for the shape

cloud_geometry = new THREE.SphereGeometry(150, 100, 100);

cloud_material = new THREE.MeshBasicMaterial({shading: THREE.FlatShading, color: 0xdcdcdc, map: map, transparent: true, opacity: 1});

cloud_mesh = new THREE.Mesh(cloud_geometry, cloud_material);

map.wrapS = map.wrapT = THREE.RepeatWrapping;

map.repeat.set( 1, 1 );

cloud_mesh.scale.x = cloud_mesh.scale.y = cloud_mesh.scale.z = 1.01;

scene.add(cloud_mesh);

//Earth

map = THREE.ImageUtils.loadTexture(‘https://steamuserimages-a.akamaihd.net/ugc/545263034473954343/68F4AB04814E6E57B78A848CEF3852476F0B00A8/?imw=637&imh=358&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=true&#8217;);

geometry = new THREE.SphereGeometry(150, 100, 100);

material = new THREE.MeshBasicMaterial({shading: THREE.FlatShading, color: 0xdcdcdc, map: map});

mesh = new THREE.Mesh(geometry, material);

map.wrapS = map.wrapT = THREE.RepeatWrapping;

map.repeat.set( 1, 1 );

scene.add(mesh);

//Stars

geometry = new THREE.Geometry();

for ( i = 0; i < 5000; i ++ ) {

var vertex = new THREE.Vector3();

vertex.x = 1000 * Math.random() – 500;

vertex.y = 1000 * Math.random() – 500;

vertex.z = 1000 * Math.random() – 500;

geometry.vertices.push( vertex );

}

material = new THREE.ParticleBasicMaterial( { size: 3, sizeAttenuation: false, transparent: true } );//this mentions the size of the star pixels

material.color.setHex( 0xff00ff );

particles = new THREE.ParticleSystem( geometry, material );

particles.sortParticles = true;

scene.add( particles );

//Background

bg = document.body.style;

bg.background = ‘#000000’;

}

function draw() {

requestAnimationFrame( draw );

//rotation cntrols the speed and the angle of which is rotates

cloud_mesh.rotation.x = Date.now() * 0.0000;

cloud_mesh.rotation.y = Date.now() * 0.0003;

cloud_mesh.rotation.z = Date.now() * 0.00000;

mesh.rotation.x = Date.now() * 0.0000;

mesh.rotation.y = Date.now() * 0.0001;

mesh.rotation.z = Date.now() * 0.0000;

moon_mesh.rotation.x = Date.now() * 0.0000;

moon_mesh.rotation.y = Date.now() * 0.0001;

moon_mesh.rotation.z = Date.now() * 0.0000;

var time = Date.now() * 0.0003; //size of pixel stars

h = (((Math.sin( Date.now() * 0.002 ))+0.75)/4)+.2; //controls the speed at which the star pixels fade and brighten

                console.log(h);

material.color.setHSL( 0.5, 1, h ); //colour of pixel stars

renderer.render( scene, camera );

}

​ setup();

draw();

</script>

</body>

</html>

Images –

The cloud image won’t show on a white page but you can click here to see the image or go here to the website – https://commons.wikimedia.org/wiki/File:Earth-clouds.png

https://steamuserimages-a.akamaihd.net/ugc/545263034473954343/68F4AB04814E6E57B78A848CEF3852476F0B00A8/?imw=637&imh=358&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=true

Earth website – https://steamcommunity.com/sharedfiles/filedetails/?id=348783119

https://lh3.googleusercontent.com/proxy/Knq3LMr0rgQKzbVDRM_S-f9jUzEqHN8tOWQU59BJNjoIjfYNeTE4mlaMb3wH1ZuVXQfjMoj_vVUtKenJmodYos-h

Moon can be seen here – http://solarviews.com/cap/moon/moonmap.htm

Video –

Processing – Ellipse Painting

The ellipse painting, I wanted to be able to create an image in the code 

For my space pixel painting set of code, I dragged and inserted my images to processing so that they are located in the data directory of the current sketch. I set up the screen size to be fullscreen and then I loaded in the different images so that they are ready to use. 

You start by setting up the variable name and tell processing what it is equal to and in this case you tell it to loadImage and then you put in the full name of the filename. For this project I used jpg and png for my different images. I also resized the images so that they fit the screen better. I set the background to black to resemble space. I also decided that I didn’t want the cursor to show unless the mouse is pressed. 

I wanted there to be two different parts to this code. One where people can watch something happen and another where they can take part and play with it a little. When the mouse is released it will show the image that is made out of ellipses in front of you. It will continue to add ellipses to the image creating a twinkling effect until the mouse is pressed. This has two functions. One it restarts the code so you can see it from the beginning and two it shows the image in full without ellipses and you can move the cursor around which is now a rocket ship. 

Understanding the code –

Below is the code. There is the image which has my notes explaining what it does and then my actual code and the images I used.

Code –

PImage galaxySpace3;
PImage rocketFire;
PImage spaceAlone2;

void setup() {
fullScreen();
galaxySpace3 = loadImage(“galaxySpace3.jpg”);
spaceAlone2 = loadImage(“spaceAlone2.jpg”);
spaceAlone2.resize(displayWidth, displayHeight);
rocketFire = loadImage(“rocketFire.png”);
rocketFire.resize(0, 500);
background(0);
noCursor();

}

void mouseReleased() {
background(0);
noCursor();
}

void draw() {
for (int i = 0; i < 75; i++) {
float x = random(width);
float y = random(height);
color c = galaxySpace3.get(int(x), int(y));
fill(c);
noStroke();
ellipse(x, y, 10, 10);
}

if (mousePressed) {
background(spaceAlone2);
cursor(rocketFire);
}
}

Images –

Video –

Conditional Design – Constellations

Constellations 

  1. Take turns placing a dot in the most empty space on the paper as quick as possible, using your chosen colour. For 3-5 minutes
  2. Connect the dots you made with a line that doesn’t cross the lines of another player. 
  3. These lines must be straight. Try complete this is in under 5 minutes
  4. Pay attention as you can have up to 2 lines coming off of one dot
  5. Each dot must have at least one line coming off of it
  6. You don’t have to only draw off your own lines and dots

This code gets people to think quickly about where to put the dots in the most empty space of the page. The lines which can be difficult to quickly add onto the dots gets people to think more about where they are going to place their next line. The end result makes up what looks like a constellations. 

The bright colours mimic the colourfulness of my other sets of code. I decided on white paper as the colours didn’t show on black paper and white makes the colours and the end result stand out. 

Final
In the exhibition
Feedback

Week 6

I was nervous for class and that maybe my code wouldn’t work but it all went really well and people seemed to like what I had made. It was impressive to see what people had made and how we had further developed the same skills in class and all came up with outcomes. I loved the ones where you can interact with the sketch. I didn’t take a lot of photos at this but it all went really well.

My feedback sheet

Week 5

This weeks class was all about preparation and getting further help with our code for weeks 6 exhibition. Tim sat down with me and helped with adding another mesh texture onto another as I was finding that it would glitch. It turns out to be very easy and I just had to make the top mesh slightly larger than the bottom mesh.

Since I was going with the space theme with Earth and having done it with Erikas code I thought adding particles would be a nice touch. Wanting to make the code more my own I decided to find a png of clouds to add on top of Earth and to follow the idea of making the code my own I wanted to play with getting the two meshes to rotate at different speeds. This meant playing around with the different parameters of the rotation snippet which each control a different aspect. Once this was worked out it made it easy to control further rotations of other meshes that I added.

Code can be seen here

Above is the first variation which has everything rotating at the same speed and at the same time. Once the cloud mesh worked how I wanted it to, I wanted to next be able to make sure that it is clear that there are two meshes and it isn’t just one image/texture. So I wanted to have them spin at different speeds. This meant playing with the different rotation elements to get to rotate the way Earth would spin rather than have it rotate like a ball rolling.

My next step was to have them spin at different speeds. I had the clouds spin faster than the Earth Click here to see Earth and the clouds spin at different speeds. I decided that visually would work better. I also wanted to add in another spinning element and I decided that having the moon sit diagonal to Earth would be a nice touch. Getting the correct positioning right took me a little bit of time but once I got it right it was easy to then get it to spin how I wanted it to. Click here to see it.

Tim then showed us how we can take our code offline. For some reason my code didn’t like that so Tim made a few adjustments and then it worked later on. The moon URL that has the link embedded to it stopped working and we struggled to work it out but I found that some URLs work and others don’t. This I am unsure as to why that is but I am glad that some work.

For some reason the moon URL stopped working

Then I decided that I didn’t want the stars to spin and just wanted to stay in one spot as everything else spins. I then later decided that I didn’t want it to change colours but instead fade out and then fade back in and brighten making it appear to slowly flash or slowly shine/twinkle. Click here to see the code. In the code you can see that the stars work but the moon has decided not to show but you can see how the particle stars are smaller, stay in one location and flash. This took sometime to work out but with Tims math skills he was able to come up with some code that would create this effect.

Here the code for the moon works but there are no stars which creates something different

Below is some forks that others have made using my code. I thought this was pretty cool due to not knowing the people so they made an effort to fork it.

Link to image if the moon URL in the code stops working – https://lh3.googleusercontent.com/proxy/35x1P6Mm87LIgTse7twOj9tH0l8pdhyGJmiDmXmzB9jSDog_ycmLNB5NMKGlj5wwZlkvO7yv3piO2HPTpp404zqb

In order to load the image in remove the text in italics below and replace it with the link above. Do this in the code.

map = THREE.ImageUtils.loadTexture(‘https://lh3.googleusercontent.com/proxy/35x1P6Mm87LIgTse7twOj9tH0l8pdhyGJmiDmXmzB9jSDog_ycmLNB5NMKGlj5wwZlkvO7yv3piO2HPTpp404zqb‘);

Moon texture
Final

Above is what I will show in week 6, I would input a threejs link but everytime I upload the code that works in Brackets and then insert it into threejs the moon disappears.

Homework

I had a lot to do to be ready for week . I had my threejs code ready and that left processing which I like as I feel that there is more possibilities but I am not good at and the conditional design which I wasn’t sure what I wanted to do yet.

“Noise flow field painter” by Jason Labbehttp://www.openprocessing.org/sketch/472966Licensed under Creative Commons Attribution ShareAlikehttps://creativecommons.org/licenses/by-sa/3.0https://creativecommons.org/licenses/GPL/2.0/ https://www.openprocessing.org/sketch/472966#

I absolutely loved this code outcome. Using lines Jason Labbe was able to create a range of images, it was beautiful to watch. When you click the mouse it restarts making up another image using lines.

I was in love with this and wanted to be able to create something like it. Since I am not the best with processing i started with going back to the basics.

As much as the colours are pretty in the video, it didn’t move smoothly when changing colour or shape. The cursor had to be at certain points in order for anything to happen.

I quite like this outcome because the flashing isn’t to overwhelming, the colours are pretty and I like that it the ellipses stop and that it is clear that they are individual ellipses and it doesn’t look like a total mess or an overload. The ellipses moved smoothly and I quite like this design. I could also make the circles smaller and use them to write or draw with. Having a way to restart the drawing so that it doesn’t appear to be to chaotic would be good too.

I wanted to be able to eventually change the cursor shape so I played with mouseX and mouseY and making sure that it follows the cursor location without leaving a trail. This only seemed to work when background was in the draw section.

I found that in order for the cursor to not leave a trail of shapes the background layer had to be included in the draw section of the code. Here I am seeing if I can control the background colour with the cursor. I like that the ellipses moves with the cursor, it is fun to play with and the colour changing background made it interactive.

Like my inspiration I wanted to be able to make my own image so I had to learn how to load and view an image so I watched a lynda.com tutorial by Barton Poulson Process:Interactive Data Visulization (https://www.lynda.com/Processing-tutorials/Interactive-Data-Visualization-Processing/97578-2.html). Here he showed how to insert and load images to be able to view them in my code. He also had videos on Variables which provided me a with a further understanding. Videos on incorporating randomness, exploring color, creating conditionals and mouse tracking. It pretty much had everything that I needed to be able to create what I did. First I made in an image in Procreate. I decided that I would continue with the space theme. I also decided that I wanted to make my own cursor so I started with creating that first. I decided that a rocket would be a good choice here so I started to code one but trying to work out the different parameters was driving me nutty and at the end of it, after spending hours I didn’t like how it looks and couldn’t work out how to use the mouseX and mouseY to make it eventually become the cursor so I scrapped it. So originally I decided to scrap this idea and move on.

My next thought was maybe I could something with more planets. I started out with with placing ellipses where I would want the planets to go and then I added in Earth. In the images below, you can see my trying to place Earth in the middle circle. The images don’t show because I keep forgetting to document and then didn’t save the code but I did manage to place Earth in the right place. The reason it took some fiddling with was the image had a different set of location parameters to the ellipses. I believe it was off by about 15.

Again, I didn’t love this idea and I didn’t know what I would do once all the planets were placed. So again I went back to my inspiration. I started with playing with randomly placing the ellipses.

Next I inserted the image. I then played the sketch and left it running to see what would happen.

Loaded image

When I decided that I wanted it to be fullscreen getting the size of the image to fit just right became a nightmare. It was always to big or to small and size I didn’t know what the full size of my screen was I was constantly trying to fiddle around with it, eventually I got it to work. When I first ran into the problem I couldn’t work out why the ellipses were white despite the colour being taken from the image and then I realised that because of the screen size it was only taking colour from the corner of the image which of course is white once I realised that, I knew to make adjustments.

Below I combined a few different videos of my progress as I didn’t want to have to keep uploading videos so I thought that this might be easier.

Video 1- 00:00-00:55

The ellipses are small in this one which makes the image appear to be more detailed. I played with the alpha which made the whole thing appear blurry.

Video 2- 00:56-01:22

The ellipses are larger here and alpha makes out the image but it has a fuzz to it and is super blurry but you can still

Video 3- 01:23-01:41

The ellipses are bigger again and the blurriness has increased but it has a clearer twinkle effect as the ellipses get layered on top of one another.

Video 4- 01:42-02:30

This time the ellipses are super small, making the blurriness disappear and the image becomes super clear and detailed.

Video 5- 02:31-4:03

This time the ellipses are super small, making the blurriness almost disappear. The blurriness can be seen once the whole image is made but still appears detailed.

As you can see I managed to work out the screen size after ages of trying to get it to fit. I then decided that actually there is to much white so I decided to make the image take up the whole space.

White outline
No outline
I decided that a white outline on the rocket ship looks best

Again a combined video of the image being full screen. The whole video shows the image being created but with different sized ellipses. The same results appeared since I still had the alpha on the bigger the ellipses the more blurry it appeared, the littler the ellipse the more detailed it appears.

I finally turned off alpha which made the whole image brighter and so much better. Below is another combined video. Each of the elements have a white outline which I liked when the image was flat and not made out of ellipses.

Here I slowly took away the outline of the images. I decided that I liked having no white outline. This also gave me my next idea. I wanted there to be something that was interactive and since I tested with playing with the cursor I decided to try and do something with that as well as the if variable.

So my idea was to have the mouse pressed and when it was to have the cursor become the rocket ship which meant taking away the space ship from the first image so that you could then fly the rocket. This meant having to change the background and then when the mouse is released the whole code would start again.

Here is the final code. It took a bit of adjusting to get it to restart correctly but we got there. I decided to leave the ellipses slightly larger just so that there was a bit more of a sense of stars twinkling and then having the mousePressed function allowed the user to see the whole image without there being ellipses and can play with the rocket.

Before I decided on my final, I wanted to try play with making it with lines which I really struggle with but I sort of got it to work, not as well as I would have hoped, it still made some cool outcomes.

Playing with different positions and thicknesses
After code was left running for a few minutes

I decided that I didn’t want an abstract piece and that I liked the ellipses more.

My next step was to do the conditional design. Making it space related took a bit of thinking but I decided that star constellations could work and is possibly something that would work.

To continue with the space theme I originally decided that black paper would be good. Sadly the sharpies didn’t show well and didn’t show the different users colours.

I then decided just to do it one white which worked great.

Part 2 – Final

Below are the instructions that I created. The blue are edits and feedback that I got from my users and watching them take part. I found that there was a sense of pressure that when drawing the lines paying attention to how many lines were coming off the dot. I also thought that maybe 5 mins was to long but it did produce a good range of dots. Drawing the lines didn’t have a time limit but I did time them and it took them 3:49:09 minutes.

Week 4

We made it to class this week! The class started with us being introduced to the different places where we could make our assignment 2 projects. We explored the fashion lab which was overwhelming but is something that I have always found to be an impressive skill. We also got to go look into Fab Lab which is what I am leaning towards for doing my assignment 2 and in particular the digital embroidery. I had a go at embroidery during lockdown and would love to have a go at doing it digital.

In class we next looked at how you can fork code which is when you take code and then build on it.

This image has an empty alt attribute; its file name is screen-shot-2020-08-17-at-2.53.58-pm.png
Taken from http://threejsplaygnd.brangerbriz.net/archive/
This image has an empty alt attribute; its file name is screen-shot-2020-08-17-at-2.53.33-pm.png
Taken from http://threejsplaygnd.brangerbriz.net/archive/

My partner for this task was also away last week so we helped each other where we could to create and fork each others designs. I also had a couple of questions for Tim where I was unsure as to why something wasn’t working and to confirm how the code works from what I didn’t understand last week, working on it from home.

Partners Work Part 1

Created by Erika Y

My partners code –

You can see her code by clicking here . This was her first time playing with threejs but I love the simplicity of the colours. It was a relaxing loop to watch.

My Work Part 1

Using Erika Ys code I was able to create this

You can see what I created by forking her code by clicking here . She named her code Linen World and that inspired me to create stary linen world. This was created by changing the background colour and adding particles. It reminds me off the Death Star.

My Work Part 2

This is what I created that Tim and Erika forked off which can be seen by clicking here it was cool to see what other people can do when branching off each others ideas. Tims code (can be seen clicking here) helped me answer my question about text. I managed to add text without paying to much attention to where I was writing it and when I had tried to add a snippet that had text it didn’t work for me so he helped me answer my questions. Erikas code can be seen here I liked that she changed the perspective and made it a lot closer to the screen making it look like it could come out of the screen in any moment.

Tims Code

Erikas code

Class

One of the questions I had was how to import an image for material. When I tried to add an image it didn’t work but with Tims help and slight adjustment in the code I was able to create a moon that spins. The only trouble was that it didn’t fill the whole ellipse. So I decided to find another image which did a better job but still had the same problem. I was silly and didn’t share them to the archive. I loved the idea which was inspired by Erikas original design Linen World. Despite the moon not filling the whole mesh and spinning to fast I like this idea and could take it in different directions once I work out the fiddly bits. I like how threeJs has snippets it gives you an idea of how the code works but some of it I don’t understand, hopefully this understanding will come with time.

The second moon image was found here – https://sservi.nasa.gov/articles/3d-moon/ I can’t remember where I got the first moon image from.

Slightly larger moon takes up more of the mesh

Example

For this weeks example I chose the gif below. What I like about is the use of depth and movement. The repetitiveness and smoothness of the movement makes it relaxing to watch. It has a sense of going from 2D to 3D. The colours make it impactful as the contrast grabs your attention.

Homework

Since I was now able to add new textures to the different meshes I had learnt in class that the previous shapes I had used didn’t work I found that using flat maps worked wonders and were exactly what I wanted as are more able to be wrapped around the mesh shape. Picture URL

Using a texture that is usually of a round shape such as planets and in this case Earth made the mesh really stand out and logically made sense to me. I was thrilled that it wrapped around the shape as intended. Since I was going with the space theme with Earth and having done it with Erikas code I thought adding particles would be a nice touch. Wanting to make the code more my own I decided to find a png of clouds to add on top of Earth and to follow the idea of making the code my own I wanted to play with getting the two meshes to rotate at different speeds. Once I had decided that this was what I wanted to do having different speed rotations I then struggled with the mesh being layered correctly. Again my bad photo taking of my processes failed me again so I didn’t show how it doesn’t work but it would glitch so you could the bottom mesh but not the top one. When played one at a time the meshes would play individually so I couldn’t work out why it wasn’t working.

The code can be seen here

It was exciting to see the texture finally wrap around the whole mesh.

The image I used for Earth

Week 3

I was away sick this week, using the videos below as recommended by Tim I was able to have a go with Three.js.

My notes from the videos –

Week 3

Part 1

  • Code on the left is JavaScript code 
  • The basic code you need ti create a mesh or a 3d object in three.js

geometry = new THREE.CubeGeometry(200, 200, 200);

material = new THREE.MeshNormalMaterial({shading: THREE.FlatShading});

mesh = new THREE.Mesh(geometry, material);

scene.add(mesh);

  • The first line says create a new cube geometry with some parameters
  • The second line creates a new material which is the skin that wraps around new geometry 
  • Third line creates a new mesh which is the combination of the previously stated geometry and material
  • Last line just adds that mesh to your scene/sketch
  • In the menu there’s a drop-down with different geometry options and when you pick a different geometry from the list
  • A new menu with the parameters for that specific geometry opens up when you adjust the sliders for these parameters you’ll notice that the code on the left changes in real time 
  • The first parameter changes when adjustinh the radius slider so that’s what that number does and likewise with these other sliders you can see how they correspond to the parameters in the code
  • The materials drop down list changes your material the basic material and there’s these other two materials Lambert and Phong which have a few more parameters which shades it in response to any lights you add to your scene 
  • In materials you can change the colour, change it to a wireframe, transparency and textures
  • Adjusting stuff in the menu and any changes that are made are being reflected in the code this is important to keep an eye on because this is how you get a sense for what each line in the code does
  • There is a plain menu which lets you generate a wireframe plane. You could also generate a solid plane with some of those pre-loaded textures and colours
  • There’s an environment menu for adding fog or changing the background color
  • Lights menu for adding different kinds of lights into your scene as soon as you start to toggle these the code for your light objects gets rendered here then just like the geometries and materials menus
    • The meshes material has to be set to either Lambert or Phong if you want it to shade in response to any lights that you add to your scene.
  • Once you’re happy with your object click on the code menu at the top and then click select code and this is going to select all the code that you’ve generated then go ahead and click command C to copy that code and move onto step two which is the editor

Part 2

  • A basic template for a web page it’s got a head which has some CSS code in it and then it’s got a body which has our JavaScript 
  • There are two files being linked, the first is the three J’s library and the second is a script which detects whether or not the person loading your sketch has a browser that supports WebGL and then in the event that that it doesn’t shows them a detailed error message
  • There’s a set up function and there’s a draw function so the set up function is where you’re going to put anything that you want instantiated as soon as the page loads and the draw function is everything that’s going to be changing or animating
  • It is a live coding environment where the editor and the final rendered sketch share the same space so you have real-time feedback you can see your sketch change as you edit the code which lends itself to this more experimental

I named it Knot Explotion … was meant to be explosion but I wasn’t paying attention. Here is the code –

<pre class="wp-block-syntaxhighlighter-code">    <a href="http://threejsplaygnd.brangerbriz.net/js/three.min.js">http://threejsplaygnd.brangerbriz.net/js/three.min.js</a>
    <a href="http://threejsplaygnd.brangerbriz.net/js/Detector.js">http://threejsplaygnd.brangerbriz.net/js/Detector.js</a>
    <script>
        //thank you Nick Briz - Made by Georgia Ronalds

        if ( ! Detector.webgl ) Detector.addGetWebGLMessage();

        var camera, scene, renderer;
        var geometry, material, mesh;

        function setup() {

            var W = window.innerWidth, H = window.innerHeight;
            renderer = new THREE.WebGLRenderer( { preserveDrawingBuffer: true } );
            renderer.autoClearColor = false;
            renderer.setSize( W, H );
            document.body.appendChild( renderer.domElement );

            camera = new THREE.PerspectiveCamera( 50, W/H, 1, 10000 );
            camera.position.z = 500;

            scene = new THREE.Scene();


            // paste your code from the geometryGUI here
            for ( var i = 0; i < 300; i ++ ) {
                // your mesh code (from the geometry GUI) goes here

                    geometry = new THREE.TorusKnotGeometry(100, 40, 64, 8, 2, 3, 1);
                    material = new THREE.MeshNormalMaterial({shading: THREE.FlatShading});
                    mesh = new THREE.Mesh(geometry, material);
                    scene.add(mesh);

            }


        }

        function draw() {

            requestAnimationFrame( draw );

            // experiment with code from the snippets menu here
            mesh.rotation.x = Date.now() * 0.00010; 
            mesh.rotation.y = Date.now() * 0.0008;  
            mesh.rotation.z = Date.now() * 0.004;
            camera.position.y = Math.sin( Date.now() * 0.002 ) * 100;
            mesh.position.x = Math.random() * 1000 - 500;
                mesh.position.y = Math.random() * 1000 - 500;
                mesh.position.z = Math.random() * 1000 - 500;
                mesh.rotation.x = Math.random() * 2 * Math.PI;
                mesh.rotation.y = Math.random() * 2 * Math.PI;
                mesh.rotation.z = Math.random() * 2 * Math.PI;
                scene.add( mesh );

            renderer.render( scene, camera );

        }

        setup();
        draw();

    </script>

</body></pre>

The link so you can see it in action –threejsplaygnd.brangerbriz.com/s/?id=8024 it posted twice to the archive which wasn’t meant to.

Off the bat, the website (http://threejsplaygnd.brangerbriz.net/) introduced us to what Three.js is able to do. The home page is interactive and as you move your cursor around the screen the squares change colours and move with you. I thought this was a great way to a possibility of what we could do. I loved that it was interactive and colorful.

Here are the different things that I created using Three.js following the videos.

Click here to see Knot Explosion it in full –

You can see flower power by clicking here

Adding mouse Input 

The following is a snippet for mouse input in Three.JS. Please note that this will not work in the Playground, you need to take your code outside the playground, as outlined above.

// Add the following code above function setup(), and below 

var mouseX = 0, mouseY = 0;

// Add the following code inside function setup(), below document.body

document.addEventListener( ‘mousemove’, onMouseMove, false );

// Add the following as a separate function. This should ideally go between function setup() and function draw() This is

mouseX = event.clientX;

mouseY = event.clientY; 

mouse = true; 

}

// Now you can refer to mouseX and mouseY in the function draw() section of your script. For example:

mesh.position.x = (mouseX-(window.innerWidth/2)); mesh.position.y = -(mouseY-(window.innerHeight/2));

mouseX and mouseY can be seen being used in the video. Since mouseX and mouseY can’t be used in threeJS you would have to copy the code and insert into brackets or similar applications.

<pre class="wp-block-syntaxhighlighter-code">    <a href="http://threejsplaygnd.brangerbriz.net/js/three.min.js">http://threejsplaygnd.brangerbriz.net/js/three.min.js</a>
    <a href="http://threejsplaygnd.brangerbriz.net/js/Detector.js">http://threejsplaygnd.brangerbriz.net/js/Detector.js</a>
    <a href="http://threejs.org/examples/fonts/helvetiker_bold.typeface.js">http://threejs.org/examples/fonts/helvetiker_bold.typeface.js</a>
        <a href="http://threejs.org/examples/fonts/helvetiker_regular.typeface.js">http://threejs.org/examples/fonts/helvetiker_regular.typeface.js</a>
    <script>

        if ( ! Detector.webgl ) Detector.addGetWebGLMessage();

        var camera, scene, renderer;
        var geometry, material, mesh;</pre>

var mouseX = 0, mouseY = 0;

        function setup() {

            var W = window.innerWidth, H = window.innerHeight;
            renderer = new THREE.WebGLRenderer( { preserveDrawingBuffer: true } );
            renderer.autoClearColor = false;
            renderer.setSize( W, H );
            document.body.appendChild( renderer.domElement );

document.addEventListener( ‘mousemove’, onMouseMove, false );

            camera = new THREE.PerspectiveCamera( 50, W/H, 1, 10000 );
            camera.position.z = 500;

            scene = new THREE.Scene();


            // paste your code from the geometryGUI here

            geometry = new THREE.TorusGeometry(160.6, 91.59, 40, 13, 21.99);
            material = new THREE.MeshLambertMaterial({shading: THREE.FlatShading, color: 0xdcdcdc});
            mesh = new THREE.Mesh(geometry, material);
            mesh.rotation.x = 2.29;
            scene.add(mesh);

            scene.fog = new THREE.Fog( 0x136bf7, 1, 9000 );ambientLight = new THREE.AmbientLight( 0x000000 );
            scene.add( ambientLight );

            hemisphereLight = new THREE.HemisphereLight(0xc292ed, 0x000000, 0.2);
            scene.add( hemisphereLight );

            directionalLight = new THREE.DirectionalLight(0xffffff, 0.38);
            directionalLight.position.set( 0, 1, 0 );
            directionalLight.castShadow = true;
            scene.add( directionalLight );

            spotLight1 = new THREE.SpotLight( 0xffffff, 0.1 );
            spotLight1.position.set( 100, 1000, 100 );
            spotLight1.castShadow = true;
            spotLight1.shadowDarkness = 0.2;
            scene.add( spotLight1 );

            spotLight2 = new THREE.SpotLight( 0xffffff, 0.1 );
            spotLight2.position.set( 100, 1000, 100 );
            spotLight2.castShadow = true;
            spotLight2.shadowDarkness = 0.2;
            scene.add( spotLight2 );





        }

        function onMouseMove(event)
        {
        mouseX = event.clientX;
        mouseY = event.clientY;
        mouse = true;
        }

        function draw() {

            requestAnimationFrame( draw );



            // experiment with code from the snippets menu here
            mesh.rotation.x = Date.now() * 0.0000;
            mesh.rotation.y = Date.now() * 0.0005;
            mesh.rotation.z = Date.now() * 0.001;
            var time = Date.now() * 0.0005;
            h = ( 360 * ( 1.0 + time ) % 360 ) / 360;
            mesh.material.color.setHSL(h, 0.5, 0.5 );
            mesh.position.x = Math.sin( Date.now() * 0.001 ) * 50;
            mesh.rotation.z = Date.now() * 0.0005;
            camera.position.x = Math.sin( Date.now() * 0.002 ) * 50;
            camera.position.y = Math.sin( Date.now() * 0.002 ) * 50;

            renderer.render( scene, camera );

            mesh.position.x = (mouseX-(window.innerWidth/2));

mesh.position.y = -(mouseY-(window.innerHeight/2));

        }

        setup();
        draw();

    </script>

</body>
        function draw() {

            requestAnimationFrame( draw );

            // experiment with code from the snippets menu here
            mesh.rotation.x = Date.now() * 0.00010;
            mesh.rotation.y = Date.now() * 0.0008;
            mesh.rotation.z = Date.now() * 0.004;
            camera.position.y = Math.sin( Date.now() * 0.002 ) * 100;
            mesh.position.x = Math.random() * 1000 - 500;
                mesh.position.y = Math.random() * 1000 - 500;
                mesh.position.z = Math.random() * 1000 - 500;
                mesh.rotation.x = Math.random() * 2 * Math.PI;
                mesh.rotation.y = Math.random() * 2 * Math.PI;
                mesh.rotation.z = Math.random() * 2 * Math.PI;
                scene.add( mesh );

            renderer.render( scene, camera );

        }

        setup();
        draw();

    </script>

</body>

Adding extra meshes

Below you can see me moving the circle and then playing the addition of another shape. I struggled with getting the shapes right… not sure how I ended up with 1 sphere that collided with a cube and another cube that I could move around. I struggled understanding how to “correctly” add in extra meshes which created some interesting, accidental outcomes. It was frustrating to not end up with an outcome that I was wanting or happy with but that is about of the process.

mouseX and mouseY

Code for the two circles –

<pre class="wp-block-syntaxhighlighter-code">    <a href="http://threejsplaygnd.brangerbriz.net/js/three.min.js">http://threejsplaygnd.brangerbriz.net/js/three.min.js</a>
    <a href="http://threejsplaygnd.brangerbriz.net/js/Detector.js">http://threejsplaygnd.brangerbriz.net/js/Detector.js</a>
    <script>

        if ( ! Detector.webgl ) Detector.addGetWebGLMessage();

        var camera, scene, renderer;
        var sphere_geometry, sphere_material, sphere_mesh;

        var mouseX = 0, mouseY = 0;

        function setup() {

            var W = window.innerWidth, H = window.innerHeight;
            renderer = new THREE.WebGLRenderer();
            renderer.setSize( W, H );
            document.body.appendChild( renderer.domElement );</pre>

document.addEventListener( ‘mousemove’, onMouseMove, false );

            camera = new THREE.PerspectiveCamera( 50, W/H, 1, 10000 );
            camera.position.z = 500;

            scene = new THREE.Scene();


            // paste your code from the geometryGUI here

            geometry = new THREE.SphereGeometry(150, 100, 100);
            sphere_geometry = new THREE.SphereGeometry(200, 200, 200);
            material = new THREE.MeshNormalMaterial({shading:
            THREE.FlatShading});
            sphere_material = new THREE.MeshNormalMaterial({shading:
            THREE.FlatShading});
            mesh = new THREE.Mesh(geometry, material);
            sphere_mesh = new THREE.Mesh(sphere_geometry, sphere_material);
            scene.add(mesh);
            scene.add(sphere_mesh);

        }

        function onMouseMove(event)

{
mouseX = event.clientX;
mouseY = event.clientY;
mouse = true;
}

        function draw() {

            requestAnimationFrame( draw );

            // experiment with code from the snippets menu here
            camera.position.x = Math.sin( Date.now() * 0.002 ) * 50;

            renderer.render( scene, camera );

            mesh.position.x = (mouseX-(window.innerWidth/2));

mesh.position.y = -(mouseY-(window.innerHeight/2));

        }

        setup();
        draw();

    </script><canvas width="1327" height="765"></canvas>

Rotating individual mesh objects in a for loop TODO

Add this below snippet to the function draw() section of your code.

 for ( var i = 0; i < scene.children.length; i ++ ) { var meshSel = scene.children[ i ]; 

// add rotations, scales, position code here. Incorporate the ‘i’ in the code to make the movements different, as with my below example. 

meshSel.rotation.x = Math.sin( Date.now() * 0.0001 ) *i; }

Example

For the example that I liked this week is from https://threejs.org/examples/#webgl_animation_keyframes

In the video I looked at a few different examples but the first clip is amazing. I love the detail and how it has moving parts such as the tram and being able to look around and examine the scene makes it much more exciting. The code for this can be seen here

Week 2

Notes

  • Blog posts talk about – what worked, what you learnt
  • Sketch window – We fill in with our graphics. Uses X (horizontal) Y (Vertical) coordinates. X goes first then Y (0.0 = XY)
  • Functions – Do something
  • Points function makes a dot
  • If we wanted to draw a line then the function is Line
  • Parameters go into the parentheses. Open and closed parentheses (  )
  • All lines end of code end with a semi colon ; similar to how we end sentences with a full stop.
  • White space tends to get ignored. Processing only pays attention to the characters. The semi colon is for the code to know when a statement starts and finishes. 
  • Processing runs your code in a sequence going down (first line bottom, last line top). It works from line to line
  • Ellipses are drawn from the centre, a rectangle is drawn from the top left corner
  • Fill function is to fill the inside of the shape
  • Fill goes from 0 – 255 to give us different colours on the greyscale. 0 = black, 128 = grey 255 = white
  • If you use fill with 1 parameters it is greyscale, 3 parameters is RGB and 4 parameters is transparency
  • strokeWeight needs to have a capital W
  • Size should be at the top
  • Using // means you can add notes with the program thinking it is code. It is a comment
  • Variables – Is used to store information e.g. width and height
  • size(300,200);
  • frameCount goes up
  •   ellipse(frameCount,height/2,50,50);
  •   ellipse(width/2,frameCount,50,50);
  •    ellipse(width/2,height-frameCount,50,50);
  • line(0,0,mouseX,mouseY);

In Class

In class we started coding using an application called Processing. We started with learning the basic codes. We learnt that the “sentence” of code is written “functionName(x,y);” Each line must end with ; as it is the equivalent of a full stop. Inside of the brackets (which are called parentheses) are the parameters that need to be specified. The function name is case sensitive as there are function names such as mouseX where the X must be capitalised. Because each line of code is read in order, in order to layer the shapes properly I had to make sure the shapes I wanted to be in the foreground to be coded last. 

The first function we learned was the “point” function. In order to create a point you need to know the X,Y coordinates. This tells the point where to go.

We next learnt the line function. I personally find this function quite difficult. It is like the point function but two locations are needed. A straight line then will be drawn connecting the two locations given. It uses the X,Y coordinates of one end and the X,Y coordinates of the other end. Not being able to see exactly what the X,Y coordinates are made it guess work which could take a long time to work out.

Next, we learnt the “ellipse” function which creates a circle. There are two set of parameters that are needed for the ellipse function to work. The first set being the location of the circle and the second set being the width and height of the circle. We also played with the order, moving the line cross to in front of the ellipse.

We also learnt the rect function, which makes a rectangle or square depending on the parameters. The set of parameters are the X,Y coordinates and then the width and height. The order of the line of code affects the layering of the shapes so here I played with the location of the square and then moved it to the back which brings the ellipse forward.

Next we learnt about the fill function. Using one parameter will fill the function with a shade of black. Using the parameter of 0 will fill the shape black and if the parameter is 255 it will be filled white and anything in between will be a shade of grey. However, to get a colour fill you would use R,G,B variables. The stroke will be automatically filled with white and have a black stroke until stated otherwise.

To create a stroke, you would use the function stroke and similar to the fill function you would use the R,G,B variables. When you want to control the transparency of the fill the parameters would be R,G,B,Alpha.

The fill and stroke function can be applied to any function because the order of code affects layering and colouring, sometimes you need to state more than once the fill and stroke. We also learnt the stokeWeight function (notice the capital W) which controls the stokeWeight. The weight (in pixels) of the strokes default is 1 and then from there it can go up, making the weight heavier.

I didn’t take as many screenshots of my mouse process but in the first image you can see my code and that the triangle head is on an angle and that I struggled with the whiskers. Struggling with the whiskers is also seen on the middle image as it didn’t make sense trying to get the ends to align. The third image you can see I managed to work it out. I was also taught that when writing a note to yourself so that the program doesn’t read it as code is to start the sentence with // . Not having all the parameters for the whiskers got me very confused but Harry was able to visually show me how to work it out which was helpful.

Code with some help from Harry understanding how to cross the lines

I did take more processing screenshots of the panda. It took me a little time to work out the ears but the mouth took me forever to get right but I eventually got there.

The final part of class, we learnt the importance of what the first set of code we should write should be. This is –

void setup(){
}

void draw(){
}

void setup only runs the code once and void draw runs repeatedly. We used the stroke function (R,G,B,Alpha) and then the line function.What was used was the mouseX, mouseY parameters. The system variable mouseX always contains the current horizontal coordinate of the mouse and mouseY always contains the current vertical coordinate of the mouse. The system variable frameCount contains the number of frames that have been displayed since the program started. Inside setup() the value is 0, after the first iteration of draw it is 1, etc.

Above I played with having a colour as well as the line function. I loved the mouseX and mouseY function and being able to interact with the outcome. I also liked that if I let it run it would move on its own and create a different set of outcomes.

Learnt functions and definitions –

  • Each “sentence” of code is written “functionName(x,y);” (must end with ; and be aware of capital letters)
  • The size function decides on the size of the play screen and is written like – size(X,Y);
  • The brackets are called parentheses and what is written in these parentheses are called parameters.
  • The “point” function. In order to create a point you need to know the X,Y coordinates e.g. point (X,Y);
  • Line function needs 4 parameters. A straight line then will be drawn connecting the two locations given. It is written like – line (X1,Y1,X2,Y2);
  • The ellipse function creates a circle. There are 2 sets of parameters that are needed. The first set being the location of the circle and the second set being the width and height of the circle. It is written like – ellipse (X,Y,Width,Height)
  • Keep in mind the order of things written. The last thing written is on top (is bought forward) which means that the first code written will be moved to the back (will be in the background).
  • The rect function creates rectangles and squares. It is written like – rect (X,Y,Width,Height);
  • The fill function can be written 3 ways –
    • For shades of black and white it is written it has one variable between 0 – 255 – fill(0);
    • For colour it has 3 variables – fill(R,G,B);
    • To change transparency there is 4 variables (R,G,B,Alpha);
  • The stoke function sets the colour used to draw lines and borders around shapes. This colour is specified in terms of the RGB or RGBAlpha
  • The strokeWeight controls the weight of the stoke (notice the capital W). The weight (in pixels) of the strokes default is 1 and then from there it can go up, making the weight heavier.
  • When writing a note to yourself so that the program doesn’t read it as code is to start the sentence with //
  • The system variable mouseX always contains the current horizontal coordinate of the mouse and mouseY always contains the current vertical coordinate of the mouse.
  • The system variable frameCount contains the number of frames that have been displayed since the program started. It starts as 0 and then after the first iteration of draw it is 1, etc.
  • Each parameter can be divided using / , multiplied * , addition + and minus –
  • Start each code with this layout (doesn’t need the lines with // but this helps to remind me of what each void does)

void setup(){
// runs once
}

void draw(){
// runs repeatedly
}

Here you can see different things that I tried. I created a YouTube playlist, the playlist should play the next video, if it doesn’t use this link (https://www.youtube.com/watch?v=_HejJyCQQ4A&list=PLENsRNu2d7MMXJq7GfT0-JVrDyUyLLW3a)

In this code, I played with the changing colour using the parameters mouseX and mouseY as well as the ellipse
Similar to the one above, I wanted to trial it again. The frame-count makes the ellipse move by itself
I wanted to trial playing with frame-count and changing the colour using the cursor. It created a different image depending on where I started and when I moved my cursor but it would always head in the same direction
Again, similar to above but being able to stop the ellipse from continuously moving in one direction with my cursor and then being able to restart it the same way
This one reminds me of a flashlight and the light reaching out into the dark
I started playing with different shapes in different locations as well as adding colour. I like having colour rather than the black and white as it appears to be more inviting and interesting
I love being able to draw and write with this code. Adding colour and life to a black background. It makes a difference in what would be an otherwise plain background
A different version to the one above where mouseX and mouseY have been switched which makes the ellipse go in another direction making it more unpredicatable
The black outline creates a sense of shadow making the final code appear to have some depth. Not a big fan of the continuous movement as it goes off the screen and you can no longer interact with it. I do like being able to control some of the movement and the colour changing that is also done on mouseX and mouseY
I like this one and being able to create a sense of depth, it stays within the screen. It appears as if the ellipse could go far in the distance and then come right back
This one created interesting patterns that could only be made once
I really like the changing colour that depends on where the mouse is and how you can create different lengths of lines

Being able to play with different parameters in my own time allowed me to experiment and create a further understanding on how they work. Some of it was trial and error to see what different functions do with different variables which created some interesting outcomes.

Week 1

Class started with completing two physical coding exercises. Basically, we were given instructions for a task to complete. The instructions were pretty clear to understand and follow. The first task was to draw a circle using a compass where the day of your birthday was. The end result was physical data. It was imperfect but it was still easy to read. The next task was using a coloured pen to redraw/copy the line above. This created a beautiful coloured pattern. Again it had its imperfections but that made it the end result more beautiful.

Taken from Stream

Continuing with physical coding we got to have a go creating a set of code for someone else to follow. The first image below on the left is what the end result needed to look like and then on the right is the code and my result that I created using the code that was created.

The second image below is my code, the users end result and what the end result needed to look like. I was happy that my code worked because it was so long and it was later discussed how it could have been made shorter by using brackets e.g. (code) x2

Possible example to make the code shorter

The next task we were put into groups to complete some more physical coding tasks. Our group ended up getting the wrong task so instead of working together as a group to complete the code we ended up doing it separately. I still believe that we worked as group to get an understanding of what we needed to do and we still talked as we completed the task. We were given 15mins to understand and then complete the task.

Instructions –

  1. Crinkle up the paper until it is a ball.
  2. Unravel and spread out the paper. Tape it to the table.
  3. Start on the farthest left side of the paper and draw a vertical line, from bottom to top, that only follows the folds of the paper.
  4. Draws another parallel line, from bottom to top, that only follows the folds of the paper. This line should be as close as possible to the previous line without touching it.
  5. Repeat step 4 until you can’t draw any more lines and the page is filled.

The next part of class was to take what we had just worked on and modify it and make it our own for another group to follow.

When Harry and I tested out the code, it was good to see someone else interpret it as well as experiencing for myself the new set of instructions.

We then switched our coding instructions. First we had to understand it which we took a little bit of time discussing what the code may mean and what it wants us to do. At the end of this task, as a class we shared our results and the group who created it gets to say if we followed the code the way they intended. They were happy with the end results but didn’t get to test it themselves to confirm. Sometimes it was hard to judge where the shortest line would be and when in a rush it was easy to misjudge. It was always corrected the next turn by another play and we worked together to work it out where the shortest line might be.

Above is the end result that the group created that followed the instructions that we created and gave them. They seemed to enjoy it and said that they also found it stressful but we could hear them challenging each other and what sounded like fun.

Below is another test that I did with my sisters to test out the instructions. We tried a couple of games on the same piece of paper. It was fun but again had a stressful element to it as well. We ran into the problem that I had had dealt with but no this much was that the paper can rip when you crumble it into a ball and then unfold. Sorry about the quality of the photo. Since it was competitive and depending on the crinkles in the paper meant that we could do multiple games as they would end quite early. This is also because with more players the less turns you had before getting “out”.

Definition – Creative coding is a type of computer programming in which the goal is to create something expressive instead of something functional.

Creative coding is a type of computer programming in which the goal is to create something expressive instead of something functional.

My own conditional design

Instructions –

  1. Draw a bunch of dots around the page, no more than 5cm apart. Make sure that the dots are clear to see.
  2. Scrunch up the piece of paper, unfold and then do again. Once unfolded the second time tape it to the table.
  3. Start in the middle of the page. Each player takes turns, using their individual colour draw a line connecting two dots together that follows the crinkle lines as best as you can.
  4. Each dot only needs to be connected once.
  5. Repeat step 3 until all the dots have been connected. Do your best to not overlap and interact with previous lines.

My result –

I wanted to follow my own instructions since when different people follow my instructions they are always going to end up with an individual outcome and I wanted some different variations so that I could see how the code works, how different people interpret it and see what they create.

People following my instructions result –

They struggled with not knowing how literally to take “draw a bunch of dots around the page”, they spent some time working out if I meant drawing the dots in a circle or not. They also was a little confusion as to if they were suppose to scrunch and unfold twice or to scrunch once and place a second round of dots. In the end they were able to create an image similar to my own and managed to follow the steps how I intended.

Improved Instructions –

  1. Draw a bunch of scattered dots on the page, try to keep the dots no more than 5cm apart. Make sure that the dots are clear to see.
  2. Scrunch up the piece of paper, unfold. Do this step (2) again. Once unfolded the second time tape it to the table.
  3. Start in the middle of the page. Each player takes turns, using their individual colour to draw a line connecting two dots together that follows the crinkle lines as best as you can.
  4. Each dot only needs to be connected once.
  5. Repeat step 3 until all the dots have been connected. Do your best to not overlap and interact with previous lines.

Precedents

Name – Redshift

Creator – JP Yepez

About – Based in New Zealand, new media artist and researcher JP Yepez incorporates different practices such as creative coding and sound design into his generative sketches. His work often boasts a glitch aesthetic and explores “expressivity, multimodality, and complex systems.” https://blog.kadenze.com/creative-technology/8-creative-coders-who-create-amazing-algorithmic-sketches/

What I like – The satisfying computer art that simulates watercolour that keeps expanding instead of drying on the canvas.

Software – Touchdesigner but creator also likes to use Javascript frameworks like P5js and THREEjs 

Further precedents that I like –

What I like about this design is the fact that it is a loop and you can get lost watching it.

View this post on Instagram

Rose ⠅⠇

A post shared by Sean Zellmer (@lejeunerenard) on

I like the colouring, the fluid motion, how it appears 3D, making it seems like you to reach out to play with it in your hands.

What I like about this videos is that the creator shows his inspirations and the steps he takes as he talks us through what he is doing.

I like this design because of its repetitive nature and how it reminds me of a wave crashing.