Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage photo; //must be at most 600x600
- ArrayList<cPoint> points = new ArrayList<cPoint>();
- void setup() {
- size(1200, 600, P3D);
- ortho();
- photo = loadImage("edit.jpg");
- for (int i = 0; i < photo.pixels.length; i++) {
- points.add(new cPoint(photo.pixels[i]));
- }
- }
- void draw() {
- background(200);
- image(photo, 0, 0);
- translate(3*width/4, height/2, 0);
- rotateX(PI-PI/8.0);
- rotateY(frameCount*PI/150+3.0*PI/2.0);
- strokeWeight(1);
- stroke(0);
- noFill();
- scale(1.5, 1.5, 1.5);
- box(255, 255, 255);
- translate(-127, -127, -127);
- strokeWeight(20);
- for (cPoint p : points) {
- p.show();
- }
- }
- class cPoint {
- PVector pos;
- color col;
- cPoint(color c) {
- col = c;
- pos = new PVector(red(c), green(c), blue(c));
- }
- void show() {
- stroke(col);
- point(pos.x, pos.y, pos.z);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement