GMU:Wild Type/Benjamin Voßler: Difference between revisions

From Medien Wiki
 
Line 246: Line 246:


= Code: =
= Code: =
import peasy.*;
PShape H;
PeasyCam cam;
void setup() {
  size(1920, 800, P3D);
  cam = new PeasyCam(this, 100);
  cam.setMinimumDistance(50);
  cam.setMaximumDistance(500);
  H = loadShape("H.obj");
  H.scale(50);
}
void draw() {
  H.rotateX(-.005);
  H.rotateY(-.002);
 
  float fov = PI/3;
  float cameraZ = (height/2.0) / tan(fov/2.0);
  perspective(fov, float(width)/float(height), cameraZ/200.0, cameraZ*200.0);
 
  background(0);
  lights();
  pushMatrix();
  //translate(1500, -400, 0);
  H.setFill(color(200, 50, 70));
  shape(H);
  popMatrix();
}
=Code:=


import peasy.*;
import peasy.*;