Sunday, 17 August 2014

Processing final

"Snake Evolution"

The concept is of a snake that follows the mouse and changes colour whenever the mouse is clicked. There are 3 parts to this code: creation of the "snake", the colour changing system, and the mouse-pressed trigger.

The "snake" is created using the storing input function. As I understand it, the shape of the circles drawn using the mouse is remembered by the program and displayed as a trail, fading away only after a certain distance/time instead of immediately. 

I first developed a colour changing "system" based on the position of the mouse and set the background to black for better viewing. 

At the same time, I incorporated the mouse-pressed function with the colour change, so that it would only happen when the mouse is pressed.

Code:

int barWidth = 1;
int lastBar = 1;
int num = 50;
  float mx[]= new float[num];
  float my[]= new float[num];

void setup(){
  size(1000,1000);
  colorMode(HSB,height,height,height);
  noStroke();
  background(0);
}

void draw(){
  background(5);

  int which = frameCount % num;
  mx[which]=mouseX;
  my[which]=mouseY;

  for (int i=0; i<num; i++){
    int index = (which+1 + i) % num;
     ellipse(mx[index],my[index],i,i);
  }

  int whichBar = mouseX/barWidth;
  if (whichBar != lastBar)
{
  if (mousePressed) {

  int barX = whichBar * barWidth;
  fill(mouseX,mouseY,width,50);
   lastBar = whichBar;

  }
  else {

  }
}
}

Threejs final

"Harmony"





http://threejsplaygnd.brangerbriz.net/s/?id=1058

The concept is of an octagram that rotates while changing colour subtly, making the colours blend into a nice harmonious ball. I set the background colour to black for better viewing. I first made a torus shape, using the basic material and changing the rotation parameters so that it would resemble a star. For the animation, I put in a simple rotation on all 3 axis, which would make the star create a nice "circle" or sphere. The colour is created by :
var s = Math.sin( Date.now() * 0.002 );
mesh.material.color.setHSL(0.5, s, 0.8 );
I have tried alternating the number to test with different colour combinations and found this one to be the most harmonious, thus the name.

Code:


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
background-color: #000000;
margin: 0;
overflow: hidden;
}
</style>
</head>
<body>
<script src="http://brangerbriz.net/labs/threejs_playGnd/js/three.min.js"></script>
<script src="http://brangerbriz.net/labs/threejs_playGnd/js/Detector.js"></script>
<script>

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
geometry = new THREE.TorusGeometry(100, 48.45, 35, 20, 47.12);
material = new THREE.MeshBasicMaterial({shading: THREE.SmoothShading});
mesh = new THREE.Mesh(geometry, material);
mesh.position.y = 8.37;
mesh.rotation.x = -5;
mesh.rotation.y = 0;
mesh.rotation.z = 5;
scene.add(mesh);




}

function draw() {

requestAnimationFrame( draw );
// experiment with code from the snippets menu here
var s = Math.sin( Date.now() * 0.002 );
mesh.material.color.setHSL(0.5, s, 0.8 );
mesh.rotation.z = Date.now() * 0.0005;
mesh.rotation.y = Date.now() * 0.0005;
mesh.rotation.x = Date.now() * 0.0005;
renderer.render( scene, camera );

}

setup();
draw();

</script>
</body>
</html>

Quartz composer final

"Pop"

The concept is of circles, or bubbles, of different sizes that rhythmically "pops", filling the screen with different vibrant colours. To make this I executed 2 macros at the same time: 1 for the "popping" bubbles, and 1 for the rotating color-changing background. The main method I wanted to incorporate into both is Wave Generator (LFO).

For the background, I inserted an image (found on the internet), then put it through hue adjustment to alter the colours. The angle of the image is at the same time simulated by 1 wave generator. The output is a rotated color-changing image.

I then used 2 other wave generators to determine crop Y and the width of that output.

The final result is then put onto the billboard to be the background. I added rotation to the background using one of the wave generators just for fun.

For the bubbles, I used 2 wave generators which linked their waves to be the parameters for the measurements of 8 bubbles. I combined and linked the waves to different measurements for each bubble to alternate their sizes, radius, positions.

Two things I wanted to improve on was the opacity of the bubbles to make it more "bubble-like", and connecting everything to an audio input, so that the size of the bubbles would act to the volume of the audio input accordingly. However, I still cannot figure out how to link audio input with the whole macro/

Unity development and final


https://www.youtube.com/watch?v=iDUUNTshcqY
https://www.youtube.com/watch?v=G1uRC7BGMXw

Final:

"Re: Azeroth"
(I could not inserted the video into my blog for some reason, so the link would have to make do)

The concept is of a fantasy world, with green hills, a valley with a large lake, opposite rocky mountains, and a volcanic? mountain that stands isolated at the far end of the map, supposed emitting an eery aura. My map is finished by various texture painting, terrain shaping and adding directional light overhead. The program would run from the first person perspective (FPS), using the keyboard to move around and jump (wasd and space bar), while mouse movement would rotate camera view.

I tried adding an "enemy" sphere and make it follow the player using the follow-me script, but it kept giving me an error regarding the mesh shape that I have not figured out how to fix, and the sphere would just stay there. For now the game could be that of an exploring type, with "treasures" as objects placing at random points at the map.

One improvement I would like to make is to include a "quest path" leading the player to their supposed destination. The path itself can be made from particles, and the destination would be an explosion. However, I have not figured out how to set the path or its direction.

Files (in compressed format) (haven't finished uploading):
https://www.dropbox.com/sh/xrqm2qjz9lx92cp/AABFtO1pOY9sPPWBEH7DYIkra

Unity 1

First try at Unity with terrain, terrain shaping and adding texture, as well as painting over different textures.