shtao@andrew.cmu.edu – [OLD FALL 2017] 15-104 • Introduction to Computing for Creative Practice https://courses.ideate.cmu.edu/15-104/f2017 Professor Roger B. Dannenberg • Fall 2017 • Introduction to Computing for Creative Practice Sat, 12 Sep 2020 00:19:01 +0000 en-US hourly 1 https://wordpress.org/?v=4.8.24 CORS Example https://courses.ideate.cmu.edu/15-104/f2017/2017/10/18/cors-example/ https://courses.ideate.cmu.edu/15-104/f2017/2017/10/18/cors-example/#respond Wed, 18 Oct 2017 05:56:01 +0000 https://courses.ideate.cmu.edu/15-104/f2017/?p=19103 Continue reading "CORS Example"]]>

sketch

    // doesn't work since not a local image
    // img = loadImage("https://courses.ideate.cmu.edu/15-104/f2016/wp-content/uploads/2016/10/rbd-hats.jpg")

    // notes say does work
    // does not work for me
    // img = loadImage("https://imgur.com/v1QmpAE.jpg")


// var img;

// function preload() {
//     img = loadImage("./cmu.jpg");
// }

// function setup() {
//     createCanvas(400, 400);
//     frameRate(10);
// }

// function draw() {
//     background(100);
//     var scaleX = max(1, mouseX) / width;
//     var scaleY = max(1, mouseY) / height;
//     image(img, 10, 10, img.width * scaleX, img.height * scaleY);
// }



function preload() {
    img = loadImage("https://courses.ideate.cmu.edu/15-104/f2016/wp-content/uploads/2016/10/rbd-hats.jpg");
}

function setup() {
    createCanvas(400, 400);
    frameRate(10);
}

function draw() {
    background(100);
    var scale = max(1, mouseX) / width;
    push();
    // we will rotate about the upper left corner of the image
    // that we will place at 10,10:
    translate(10, 10);
    // use mouseY value to determine rotation angle
    rotate(radians(90 * mouseY / height));
    // since we translated by 10,10, the "origin" for the image
    // is 0, 0:
    image(img, 0, 0, img.width * scale, img.height * scale);
    pop();
}

Hello!!

sketch

    // doesn't work since not a local image
    // img = loadImage("https://courses.ideate.cmu.edu/15-104/f2016/wp-content/uploads/2016/10/rbd-hats.jpg")

    // notes say does work
    // does not work for me
    // img = loadImage("https://imgur.com/v1QmpAE.jpg")


// var img;

// function preload() {
//     img = loadImage("./cmu.jpg");
// }

// function setup() {
//     createCanvas(400, 400);
//     frameRate(10);
// }

// function draw() {
//     background(100);
//     var scaleX = max(1, mouseX) / width;
//     var scaleY = max(1, mouseY) / height;
//     image(img, 10, 10, img.width * scaleX, img.height * scaleY);
// }



// function preload() {
//     img = loadImage("https://courses.ideate.cmu.edu/15-104/f2016/wp-content/uploads/2016/10/rbd-hats.jpg");
// }

// function setup() {
//     createCanvas(400, 400);
//     frameRate(10);
// }

// function draw() {
//     background(100);
//     var scale = max(1, mouseX) / width;
//     push();
//     // we will rotate about the upper left corner of the image
//     // that we will place at 10,10:
//     translate(10, 10);
//     // use mouseY value to determine rotation angle
//     rotate(radians(90 * mouseY / height));
//     // since we translated by 10,10, the "origin" for the image
//     // is 0, 0:
//     image(img, 0, 0, img.width * scale, img.height * scale);
//     pop();
// }


function preload() {
img = loadImage("https://imgur.com/v1QmpAE.jpg")}

function setup() {
    createCanvas(400, 400);
    frameRate(10);
}

function draw() {
    background(100);
    var scale = max(1, mouseX) / width;
    push();
    // we will rotate about the upper left corner of the image
    // that we will place at 10,10:
    translate(10, 10);
    // use mouseY value to determine rotation angle
    rotate(radians(90 * mouseY / height));
    // since we translated by 10,10, the "origin" for the image
    // is 0, 0:
    image(img, 0, 0, img.width * scale, img.height * scale);
    pop();
}

]]>
https://courses.ideate.cmu.edu/15-104/f2017/2017/10/18/cors-example/feed/ 0
Looking outwards week 1 placeholder test https://courses.ideate.cmu.edu/15-104/f2017/2017/08/29/looking-outwards-week-1-placeholder-test/ https://courses.ideate.cmu.edu/15-104/f2017/2017/08/29/looking-outwards-week-1-placeholder-test/#respond Tue, 29 Aug 2017 04:19:47 +0000 https://courses.ideate.cmu.edu/15-104/f2017/?p=8222

sketch

function setup() {
    createCanvas(200, 20);
    background(220);
    text("p5.js vers 0.5.12 test.", 10, 15);
}

function draw() {
    background(200);
    ellipse(mouseX, mouseY, 100, 70);
}

 

hi this is a placeholder

cmu
]]>
https://courses.ideate.cmu.edu/15-104/f2017/2017/08/29/looking-outwards-week-1-placeholder-test/feed/ 0