How to use scale() in p5.js

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 44

  • @chrblubb
    @chrblubb 4 роки тому +8

    This channel is the best thing that has happened to UA-cam and open education in years

  • @ChristianSchmid
    @ChristianSchmid 5 місяців тому +1

    I think for this tutorial a text like "HELLO" would be a good object because you can see the mirroring very easily

  • @sadhlife
    @sadhlife 7 років тому +17

    I just want to say that you're a great person and I look up to you.

  • @superdepressif6047
    @superdepressif6047 7 років тому +14

    I missed your videos good to see you back

  • @laikesagores3258
    @laikesagores3258 2 роки тому

    Hello from Greece. Thank you!

  • @Muffin--Man
    @Muffin--Man 3 місяці тому

    This allows you to create illusions of 3d rotations:
    let a= 1;
    function setup() {
    createCanvas(400, 400);
    rectMode( CENTER);
    }
    function draw() {
    background(220);
    let x=map( mouseX, 0,width, 1,4);
    let y=map( mouseX, 0,height, 1,4);
    translate( 200,200);
    rotate(frameCount*0.01);
    scale(-cos(a/4) ,sin(a/4));
    scale(x,y);
    rect( 0,0,50,50);
    a+=0.1;
    }

  • @tomburris8380
    @tomburris8380 7 років тому +1

    Glad to have you back Dan! :)

  • @erich2s_0103
    @erich2s_0103 2 роки тому +1

    This 8min video is better than my 5months college course

  • @FritsvanDoorn
    @FritsvanDoorn 7 років тому

    Interesting. Never thought of a negative scale. Thank you!

  • @nouserjjj
    @nouserjjj 4 роки тому

    i really miss this kind of videos nowadays u only upload steams about ml

  • @divyanshjain5383
    @divyanshjain5383 3 роки тому

    awesome explanation

  • @BKDREAM09
    @BKDREAM09 2 роки тому

    Thanks!

  • @Ark-ju2gt
    @Ark-ju2gt 7 років тому

    Thank's for explaining this mindblowing function xD

  • @etemkaandelibas3649
    @etemkaandelibas3649 7 років тому +1

    Glad to see you

  • @hijakyung
    @hijakyung 2 роки тому

    thanks

  • @cleverninja5162
    @cleverninja5162 4 роки тому

    you are pro in code keep it up

  • @jorgenisjobo8667
    @jorgenisjobo8667 7 років тому +2

    Yeeeees!!!

  • @Worldcamping91
    @Worldcamping91 6 років тому

    I find your viedo so great ,thank you

  • @xlayrs
    @xlayrs 7 років тому +1

    Thanks :D

  • @mohammadfarhad8617
    @mohammadfarhad8617 5 років тому +1

    I just want to know how to increase or decrease the size of the object, along the y-axis.
    example:-at the top the is object is small and at the bottom the object is large.

  • @vadsavin
    @vadsavin 7 років тому +4

    Hay, what's about Neural Networks tutorials? I miss them)

  • @renecura
    @renecura 6 років тому

    Hi Daniel, I'm struggling with a problem and can't figure out the solution.
    By applying sequence of lines, translations and rotations, I'm making turtle drawings (You know, L-Systems) and I'm trying to "auto-fit" the resulting drawing inside the canvas, but I don't know how to apply the proper scale after all the transformations. Any idea or advice? Thank you.

  • @pietarikellokumpu5423
    @pietarikellokumpu5423 5 років тому +2

    Really helpful and informational videos! Thank you! I applied these transformation tutorials to processing learning and here's the outcome:
    //ZZOOOOM
    float angle = 0;
    float depth = PI;
    float vari = 0;
    void setup(){
    size(400,400);
    rectMode(CENTER);
    noStroke();
    fill(244,200,100);
    rect(100,100,200,200);
    }
    void draw(){
    background(vari);
    pushMatrix();
    translate(200,200);
    scale(cos(depth));
    fill(255,40,20);
    ellipse(0,0,300,300);
    popMatrix();
    pushMatrix();
    translate(200,200);
    rotate(angle/cos(PI/10)/10);
    scale(sin(depth)* 12);
    fill(200, 0, 150,100);
    rect(0,0, 100, 100);
    fill(252+vari,186+vari,3+vari);
    rect(0,0, 50,50);
    popMatrix();

    pushMatrix();
    translate(200,200);
    scale(sin(angle/50),sin(angle/50));
    rotate(-angle* 0.2);
    fill(40, 200, 100,150);
    rect(0,0, 300, 300);
    popMatrix();
    pushMatrix();
    translate(200,200);
    scale(sin(angle/20),sin(angle/20));
    rotate(angle* 0.1);
    fill(255, depth, depth,150);
    rect(0,0, 300, 300);
    popMatrix();
    pushMatrix();
    translate(200,200);
    scale(sin(angle/200),sin(angle/200));
    rotate(angle* 0.1);
    fill(255, 20, 200,150);
    ellipse(0,0, 300, 300);
    popMatrix();
    angle = angle +0.08;
    depth = (depth + 2 * angle)/10;
    vari = vari + (sin(angle/200));
    if(vari>270){
    vari = vari-1;
    }
    }

  • @falkelh
    @falkelh 4 роки тому

    This video has the best like-dislike ratio I have ever seen!

  • @virentovoshe6773
    @virentovoshe6773 6 років тому

    How can you have 2 simultaneous rotations at the same time if the viewport is being displace. Unless there are more than one view port?

  • @natwatgamer2805
    @natwatgamer2805 3 роки тому

    I put the video on 2x speed so I could learn twice as fast

  • @جبهةلبنانية
    @جبهةلبنانية 6 років тому

    You're funny I love you so much (by the way nice beard)

  • @aaronledesma5444
    @aaronledesma5444 5 років тому

    How can we scale the mouse coordinates?

  • @Andy-bz9cb
    @Andy-bz9cb 3 роки тому

    what does (mousex/100) meaning?? is it different from a simple (mousex)??

    • @abhayagarwal5097
      @abhayagarwal5097 3 роки тому

      mouseX simply has too big value , dividing by 100 reduces it to quite less , for example 350 is reduced to 3.5

  • @niharranjanbhuyan9839
    @niharranjanbhuyan9839 7 років тому

    I want to learn too much things from you

  • @clashbluestar3099
    @clashbluestar3099 7 років тому +1

    What is java script ou c++ ou c# please

    • @CP-nt8ng
      @CP-nt8ng 7 років тому

      clash blue star tu es français ?

    • @goldmanlee8403
      @goldmanlee8403 7 років тому

      JavaScript (not to be mistaken with Java) is a web functional language.
      C++ is a inherited super class of C and with C is generally used to make hardware, low-level systems or kernels and applications.
      C# is a language under the .NET framework by Microsoft and is generally used for business applications or Unity games.

  • @niharranjanbhuyan9839
    @niharranjanbhuyan9839 7 років тому

    Sir tell me your fb name please