• Home
    • Projects >
      • Finn's Golden Sword - Adventure Time
      • Game Development
      • Animation
      • Graphic Design
      • Photography
      • Archviz
      • HCI Systems
      • 3D Printing
    • Creative Blog >
      • AME 394
  • Contact
  • 3D Gallery
  CMA3D

3D Cube Manipulation | Processing | 9 - 21 - 2013

9/22/2013

0 Comments

 
I initially was trying to create a 3D cube and manipulate it to squash and stretch similar to previous sketches we've looked at in class, but then I tried hard-coding my own translation and rotation patterns. I then added the mouseX and mouseY system variables to dynamically change more draw variables.

I'm hoping to eventually get the squash and stretch of the cube/other geometry eventually figured out.
/*
Christopher Michael Andrew
Assignment 1
3D Space
Manipulation of Cube in 3D space
*/


float x = 400;
float y = 100;
float speed = 0;
float stretch = 1;
float squash = 0.1;
float gravity = 0.1;
float size = 100;
float center = 0;
//int value = 0
PVector location;
PVector velocity;


void setup() {
  size(800,600,P3D);
  smooth();
  /*location = new PVector(100,100,100);
  velocity = new PVector(2.5,5);*/
}
/*void mousePressed(){
  if (value == 0) {
      update += 15;
  } else {
    value = 0;
  }
}*/
void draw(){
  background(0);
  lights();
  noStroke();
  pushMatrix();
  /*location.add(velocity);
  if ((location.x > width) || (location.x < 0)) {
    velocity.x = velocity.x * -1;
  }
  if ((location.y > height) || (location < 0)) {
    velocity.y = velocity.y * -1;
  }*/
  translate(x, mouseY, center);
  //translate(location.x,location.y,location.z);
  rotateY((0+mouseY*.025));
  rotateX((0+mouseX*.025));
  box(((mouseX+mouseY)/6));
  //box(100);  //10-300 for distance 100 is standard size
  popMatrix();
  y = y + speed;
  stretch = abs(speed);
  speed = speed + gravity;
  if (y >= height) {
      speed = speed * -0.98;
  }
}





0 Comments

    Michael A.

    Digital Culture @ ASU + Game Development Certificate 14'

    Archives

    December 2013
    November 2013
    October 2013
    September 2013

    Categories

    All

    RSS Feed

Copyright (c) 2010 Christopher Michael Andrew