This guy makes me feel like it's okay to be as awkward as I am and it's so comforting
@susiesan5 жыл бұрын
It's very endearing
@MegaOmpuri4 жыл бұрын
So true!!
@freddiejonesy61683 жыл бұрын
So true!
@mucjwt85503 жыл бұрын
true.. a kind of comfortable awkwardness.
@krccmsitp28842 жыл бұрын
We call this neurodivergent nowadays. 🙃
@KaizenCodes5 жыл бұрын
Does anyone else ever get stuck on some code and remember a Coding Train video about it - but instead of just skipping to the part where Dan explains, you end up re-watching the entire nature of code series?
@SoDamnMetal3 жыл бұрын
Yep that's exactly what i'm doing :D
@GlobalSingeing6 жыл бұрын
I like how he mentions Vimeo in 2015 lol Currently watching through your whole Nature of Code series after starting with the Neural Network one. You thoroughly impressed me as a teacher. You remind me of a less edited Vsauce. Keep up the good work!
@yashaswinis45 Жыл бұрын
Vsauce! Exactly! Thought I was the only one who found that faint similarity
@redink8919 жыл бұрын
Your videos are so cool, keep it up! No one else makes coding and math so funny and entertaining! :D
@anthonycokayne74537 жыл бұрын
Easily the best programming videos on KZbin, such a great energy, I'm constantly smiling whilst following along.
@OstiguyBass4 жыл бұрын
Re-visiting all nature of code but I will do the home works this time instead of just creating stuff randomly. Thanks for everything. This is SOOOOO useful. Your the best !
@JulioCesar-gz3kz3 жыл бұрын
I just star learning how to code video games because I'm teaching my 12 year old son how to code, but we'd had having issues trying to do every with x and y varíables, but thanks to you I learned how to use vectors and now everything is a lot easier. Greetings from 6 years in the future. By the way the way you teach is awesome!
@DavidDaybreakASMR7 жыл бұрын
I have to say: I have been following along from I.0 to here, and I'm glad that you've kept all of the codes relatively short (seeing as codes can get thousands of lines long). I have been able to easily replicate your examples-and I hope that I continue to work through this until I can make some sort of game!
@beil35375 жыл бұрын
I want what you're on Dan! You have the most amazing upbeat disposition - and such a brilliant educator. Just awesome.
@insidethematrix7557 жыл бұрын
@6:13 Living with your weird ramblings. Sometimes those ramblings help me understand better. Keep the weird ramblings and NEVER cut them out =)
@JohnnyDub087 жыл бұрын
Hey Dan..yes.. you were more funny back then.....just kidding... you're still very funny. Everybody should have a teacher like you. Thank you for all the work and effort you put into making programming more accessible. You are great!
@Ferocious_Imbecile6 жыл бұрын
I got bogged down a bit on your Learning Processing Chapter 9 with the Arrays so I came over here to have some fun. It was fun. Thanks.
@jowadulkader90068 жыл бұрын
thank you sir.you are an excellent teacher.your videos are very interactive,funny and above all very easy to learn from.thanks a lot
@RRKS_TF4 жыл бұрын
8:17 there's this thing called operator overloading that allow you to change what operators do for your class. I.e; add the X and y positions of 2 points and return the new vector. I don't know if it's in java but it is in c#
@WistrelChianti2 жыл бұрын
8:40 I could see you running full long at that cliff drop while thinking "OK how's he going to explain THIS one" and loved your "you just can't do that" bail. =D Epic! [Not faulting BTW, totally get your reasoning just enjoying the comedy - it would take a lot of work to explain]
@rhazzzvvv3 жыл бұрын
Entertaining while teaching coding. Love it!!
@sreekesariv.90593 жыл бұрын
Wonderful explanation Dan!!! I just wanted that bouncing ball to bounce-back right after hitting the wall. Sent a PR to the github-repo 😅 introducing a new variable `ballRadius`... Learning many new things from your series, thanks for doing this!
@thelumiereguy4 жыл бұрын
Kotlin has a feature where you can implement the operations you want to use with your class. So within my class, I can say operator fun plus(value : Int) (Predefined), but I define the implementation part myself.
@robthompson13318 жыл бұрын
Thank you very much.Thats what I call infotainment! Keep going Mr Shiffman
@TheCodingTrain8 жыл бұрын
+Rob Thompson Thank you!
@ShaolinMonkster8 жыл бұрын
Why this channel has only 36k subs. You are awesome
@caio-jl6qw5 жыл бұрын
look again
@loltool55135 жыл бұрын
And now
@benjaminvanderwolf52396 жыл бұрын
definitly love your videos man. You are a great teacher. bingewatching your videos at the moment ^^
@colemasuno73044 жыл бұрын
Your videos are so fun to watch at 2x speed :-D Thank you so much!
@riguidixrodriguez10904 жыл бұрын
I really love how to understand all with you :D you're so cool :) the best teacher ever, take care w/Corona :(
@GonzoGonschi9 жыл бұрын
super excellent and entertaining presentation. Thank you so much for the effort Daniel!
@gauravagarwal65653 жыл бұрын
When you said location. X how does x got binded and how it knows location. X is the first value of pvector
@conan57438 жыл бұрын
I love the way you teach Thank you for doing this , and also the explaining you do makes it easier to understand . Than You
@rahulmathew87134 жыл бұрын
Awesome work !!! Really loved your videos
@manualvarado22126 жыл бұрын
5:53 I was just thinking a few seconds before on how good those key presses sound.
@chanasiegel27064 жыл бұрын
Whenever I run it I get "UNCAUGHT SyntaxError: Unexpected identifier". Please help. You are an amazing teacher by the way.
@ettorefagioli10124 жыл бұрын
I don't know too! Help us!
@chanasiegel27064 жыл бұрын
I just realized that he is coding processing and I tried it in p5js. That's what caused the error. In p5js you say 'let location' and 'location = createVector'.
@corey333p8 жыл бұрын
When I say: location = new PVector(width/2, height/2); location.x and location.y become 50. It's as if location coordinates are being set to a percentage with respect to the drawing dimensions. If this is the case, I can work with it, but I'd like to know it doesn't seem to be using x and y coordinates directly? My screen size is 800x600 so I expected values of location.x and location.y to be 400 and 300 respectively
@paulbelfrage7 жыл бұрын
Made this to better understand. Used println to print the vectors in console PVector v1; PVector v2; void setup() { size(500,500); background(255); v1 = new PVector(250,250); v2 = new PVector(10,10); frameRate(1); } void draw() { noStroke(); fill(255); rect(0,0,width,height); // Add vector v2 to vector v1 v1.add(v2); // subtract vector v2 to vector v1 //v1.sub(v2); stroke(0); fill(100); strokeWeight(5); line(v1.x,v1.y,v2.x,v2.y); println("v1" + v1); println("v2" + v2); println("-------"); }
@ruizanchetta12203 жыл бұрын
Could I separate the coordinates of PVector and do this math: location.x.add(velocity.x)? Could I add just the x component of the location PVector?
@emmanuelgatica49984 жыл бұрын
You should do this same course but in Javascript. I am watching this doing Javascript instead of Java and it would be so much easier not having to translate Java to Javascript.
@weizheng86378 жыл бұрын
I watched the 1.4 Vector Math, there is one line I am not sure, mouse.sub(center), I was wondering what is the "centre" stands for? Million Thanks!
@liachrys93257 жыл бұрын
I live for these videos... thank you
@alejandromurillo21743 жыл бұрын
Excellent explication....I like
@yasaminkhalilbeigikhameneh41828 жыл бұрын
U made processing funny and lovely for me
@jamesvic10006 жыл бұрын
Can the PVectors be evaluated (i.e. for autonomous vehicle target evaluation)? Thanks!
@kevinbay95428 жыл бұрын
These are great, thanks Dan! ...I have a feeling I'm not the only one learning this in Processing and then translating it for use in p5.js along the way. It's a great exercise, but is there a Nature of Code p5.js repository somewhere?
@TheCodingTrain8 жыл бұрын
+Kevin Bay Here you go! github.com/shiffman/The-Nature-of-Code-Examples-p5.js (and I'm hoping to release a p5.js version of the entire book soon too!)
@TheCodingTrain8 жыл бұрын
+Daniel Shiffman Also this will be in p5.js: www.kadenze.com/courses/the-nature-of-code
@kevinbay95428 жыл бұрын
Yahoo! Thanks!
@snnpa5 жыл бұрын
Is it possible to make video to vectors? I would like to film a person and change that person to vectors and lines. So when the person moves, it just lines moving.
@007aha16 жыл бұрын
i can also do this with an 2 dimensional array right?
@YaroKasear4 жыл бұрын
Processing doesn't do any operator overloading? That seems odd.
@diegoferreira34447 жыл бұрын
thank you so much love ur videos, btw when's the next stream?
@TheCodingTrain7 жыл бұрын
If you subscribe and click the alarm bell icon you'll get a notification when I schedule it.
@clementeferrer50707 жыл бұрын
I really like your wallpaper. Where did you find it?
@olfmombach2607 жыл бұрын
Selfmade with Perlin noise and force fields I guess
@bradleystone90997 жыл бұрын
Is there any reason why all of this wouldn't work the same in Brackets?
@mohshafi30325 жыл бұрын
Thank you for your effort, could you please let me know what programming language is that you have coded the "Class Ball"
@spectre.88045 жыл бұрын
It's Java
@xia10965 жыл бұрын
for me, it doesn't work, it said "looks like you are mixing active and static modes ", anyone knows what happened there?
@lewisshemery25857 жыл бұрын
is a vector essentially a slope?
@Djzaamir7 жыл бұрын
Thank you Sir , someday i am gonna meet you and have a cup of tea with you :)
@saiBee74 жыл бұрын
how does processing know x, y variables?? you never initialized it.?? is it inherent..
@iYankrozHD6 жыл бұрын
Hey Coding Train. I have a question regarding vectors in p5. How come the createVector function only takes one point in a 2d space? Surely, a vector needs to be constructed from two 2d points, so obviously it has the origin as one of the points, but wouldn't it make more sense to have the option of entering two points?
@TheGBsXB6 жыл бұрын
createVector([x], [y], [z]); x & y & z are optional, that means if: createVector(); // x = y = z = 0 createVector(7); // x = 7 & y = z = 0 createVector(11, 7); // x = 11 & y = 7 & z = 0 createVector(13, 7, 11); // x = 13 & y = 7 & z = 11 I know it is a late reply but it might help someone else, good luck!
@kaz3724 жыл бұрын
It only needs one point, if you instantiate a vector with x=2, y=2, this means your vector goes from 0 to 2 on x axis, same for y on y axis. If you have a velocity vector of (-1, 1), and you add it to you position vector(2,2), your new vector position is (1,3) From origin you have actually gone right 2 units then left 1 unit, up 2 unit then up 1 unit, leading you to (1,3). And if you subtract your current position from your previous one, you'll get the velocity vector of same magnitude with opposite direction than the velocity vector that led you where you landed, (2,2) - (1,3) = (1,-1)
@katupeku084 жыл бұрын
What is the initial magnitude of a vector, if it doesn't have a second vector? Greetings from Argentina !
@kaz3724 жыл бұрын
A vector is not a lone and isolated point, it's the coordinates where you land after a move, it traduces a relationship between two points, thus it always assume a starting point, an origin. If no point is precised to be the origin of the move, then the origin simply is the absolute origin of the whole space (coordinates 0,0), and the vector magnitude will be sqrt( vector.x**2 + vector.y**2 )
@katupeku084 жыл бұрын
@@kaz372 thanks !
@kaz3724 жыл бұрын
@@katupeku08 you're welcome, and if I can reformulate, it's actually not "the coordinates where you land after a move", it's the distance you travel on x and y axis respectively from a starting point !
@sweethomes674 Жыл бұрын
Wonderful 😊
@skoskop2 жыл бұрын
how do I import PVector , I couldn't find anything online for it .
@GERARADO3457 жыл бұрын
my ellipse doesnt work when i put my pvectors in please help
@UnbornFamas5 жыл бұрын
Mine Didn't work :/ I have you're book and I have followed your video and the book and all I get is a ball that doesn't move now :(
@corykilpatrick11755 жыл бұрын
My code looks verbatim but I'm getting errors - The constructor PVector(int, int) is undefined The function add.PVector does not exist The global variable x does not exist
@samanthayong68146 жыл бұрын
Great teaching! I actually understand haha 👍
@Shockszzbyyous7 жыл бұрын
there is a way to override the + operater in java right?
@Shockszzbyyous7 жыл бұрын
apparently not, but why does string have this behavior ?
@olfmombach2607 жыл бұрын
Hardcoded I guess
@DJTechno947 жыл бұрын
Mind if I steal some of that good mood?
@manualvarado22126 жыл бұрын
13:17 A painting, a painting.
@RenkoGSL Жыл бұрын
That was java. This is the corrected solution for ps5js class Ball { constructor() { this.location = createVector(width / 2, height / 2); this.velocity = createVector(2.5, -2); } move() { this.location.add(this.velocity); } bounce() { if (this.location.x < 0 || this.location.x > width) { this.velocity.x = -this.velocity.x; } if (this.location.y < 0 || this.location.y > height) { this.velocity.y = -this.velocity.y; } } } let ball; function setup() { createCanvas(400, 400); ball = new Ball(); } function draw() { background(220); ball.move(); ball.bounce(); ellipse(ball.location.x, ball.location.y, 20, 20); }
@brenttrenholme76096 жыл бұрын
I don't understand how to make a PVector it doesn't work for me
@waltersilvestrini65446 жыл бұрын
What language and what IDE is he using?
@TheRemiRODRIGUES6 жыл бұрын
Processing ! processing.org/
@cimmik8 жыл бұрын
I get this error when I tries to declare "private PVector position;": Cannot find a class or type named "PVector"
@cimmik8 жыл бұрын
Is it because I use it in a class in a file called Walker.java?
@TheCodingTrain8 жыл бұрын
correct, you need all the java imports if you are using java files and not pde files.
@cimmik8 жыл бұрын
Thank you for you answer. I found out that, but youtube wouldn't let me do anything with my comment.
@corey333p8 жыл бұрын
I was having the same problem because I was using "Pvector" instead of "PVector"
@MrOdammy7 жыл бұрын
how do i write this in my p5 ide?
@nikims_4 жыл бұрын
With your keyboard
@zoilo877 жыл бұрын
What is the file type for the class Ball?
@TheCodingTrain7 жыл бұрын
"pde" for "processing development environment"
@UnbornFamas5 жыл бұрын
Hey My ball isn't moving :(
@letsgocamping885 жыл бұрын
The pen looks like a magic wand. I think you need a magic wand for your new stuff.
@UniverseGOD25258 жыл бұрын
THANKK U SO MUCH
@silaseriksen57717 жыл бұрын
What editor to use??
@silaseriksen57717 жыл бұрын
Thanks! Is it possible to resize the "canvas"?
@silaseriksen57717 жыл бұрын
Just found out about the size() function
@Kampouse4 жыл бұрын
funny how some of your content could pay to watch but you do it for ()
@Rudyok00013 жыл бұрын
5:54that kinda freaked me out, lol look at my user name
@shelleyj88137 жыл бұрын
I wish he was my teacher instead of "Te Taka" #boycottTeTaka
@Tejas-zx7ie5 жыл бұрын
But can you adopt me?
@GonzoGonschi9 жыл бұрын
super excellent and entertaining presentation. Thank you so much for the effort Daniel!