Thank you all for watching! Got another episode coming next week 🎉 Check out Brilliant to learn all the math you need and support the series - visit brilliant.org/TheCherno to get started learning STEM for free (first 200 people will get 20% off their annual premium subscription)
Hey! Love your videos, they are so motivating and exciting, you're one of the best people I've ever known. Can you please suggest what is the best library to start from for creating program to visualize frame three-dimensional model of the body, display it on the stage with and without perspective, scale and rotate? Maybe there are some books that you would recommend, thanks so much in advance
If you really want to take your time with it, get a chunk of clay and mold it into a sphere. Then set it on some graph paper and use some analog hand calipers and measure all of the visible points on it. Then plot those in a file and write a for loop to draw each pixel to the screen. Done. 😂
3:10, there's a simpler way to see if it hits the object, any xy point of a hypotenuse can be normalised between 0 to 1, everyone follows that fine right? The same normalised point can be calculated with 3 lines of math on an integer angle, modulo being part of that math, once the relative xy integers are calculated just normalise them then multiply against the height & width for the actual points relative to the dimensions of the triangle, similar can be done with curves however an extra 2 lines are needed at minimum since you need to modulo the integer axis values by 3 to get the relative numbers to add to the original axis value, I'll show an example when I finish getting my trial library to a state where I can translate the math I worked out on paper to glsl. **Edit:** Realized I forgot to mention how this applies to object hitting, you multiply the normalised values on the object dimensions to get the hit box edge hit, then you just check if the outer hit diameter falls outside half the positions calculated for simple check, for nit picky check against the vertices you just need to check their positions are all greater or equal to the halfway point, if the halfway point falls inside the inner hit diameter then the nitpick check is not needed since it's guaranteed to be a hit
I just realised there's an even simpler way to do the nit pik part, all it requires is 2 vertice "textures", 1 for where vertices of the the object fall in the z axis, the other is a lookup table for the furthest out vertice falling in that space, every thing from there is just using the nearby indices to spread the hit on the display side of things, if NaN is stored in a "pixel" of the 1st texture then no vertice happens to fall into said "pixel", and just get's ignored, as for the dimensions of said "textures" the maximum should be relative to the smallest vertice position value used, so for example if you have just 1 vertice defined as 0.1, 0.2, 0.3 etc then you'll need at most 11 "pixels", if it's 0.01, 0.02, 0.03 etc then 100 "pixels", the point is to have at most what the largest value would be if you ignored the dot plus 2 extra for 0 & 1 **Edit:** Correction, 4 "textures" minimum, I only considered from the front, which would only get one half of the vertices that need to check against, the extra 2 are the same but for the back of the model instead, there could be checks for other visible vertices if you create the same kind of "textures" for all 6 faces of the objects box, you just need adapt the checks according to the facing's axis, still faster than square rooting the ray then checking each individual vertice, better to just use lookup "textures" that are ignorant of the surrounding area since it only needs to know the ray's entry & exit points in normalised form
@@zxuiji Neat, but for simplicity's sake I would just use a rectangle around objects I want hit boxes for and make it as tight as possible to the model in question. Super fast even if it is inaccurate, and for most purposes I'd say good enough.
@@anon_y_mousse Well if you're doing ray math anyways then might as well let the physics engine lookup the vertice via the "texture" maps anyway it would probably cost at most 1 extra nanosecond instead of the flat box method
@@zxuiji If you have a ray tracing graphics card, if ray tracing is turned on, then sure. Otherwise, it's at least a good idea to know how to do both and have both as options in case the user has crappy hardware or chooses to use less power on say a laptop with limited battery life.
@@anon_y_mousse You don't need a RT enabled gfx card to do RT, the method is just slightly slower due to not having hardware built specifically for it, it's also useful for physics, RT is not solely for light, it just happens to be most prominent in light
I'm wondering how you made the thumbnail of this video? That's really cool! Are there any image tools for spherically distorting a part of the image? Please don't tell me it's rendered by adding your face as a texture on the sphere....
Why not just write the initialisation of the Sphere like `Sphere sphere{ .Position = { 0.f, 0.f, 0.f }, .Radius = 0.5f, .Albedo = { 1.f, 0.f, 1.f }};` ? You get the names, guaranteed the minimum amount of instructions without setting the defaults first etc.
Linear Algebra and Numerical Mathematics are really helpful. LA is all about Vectors, Matrices and the connection between geometry and algebraic equations. NM shows and proves methods to calculate solutions of equations on a computer
Frankly I think graphics programming in general should abandon the concept of a scene, all there should be is -1 to 1 of the parent area, that's all the area that need since everything will scale according to the parent scale
A scene is just a collection of nodes (such as entities) commonly put in a tree structure. I don't know why you are mentioning area about something that is just a collection of things. If I have a collection of objects in a list do you try and find out the "area" of that list? How so? Especially as lists don't have an area.
Thank you all for watching! Got another episode coming next week 🎉 Check out Brilliant to learn all the math you need and support the series - visit brilliant.org/TheCherno to get started learning STEM for free (first 200 people will get 20% off their annual premium subscription)
;)
@The Cherno, Absolute genius! I learned more about imgui tricks than multiple renderings, which is perfectly a good thing I love using ImGUI!! 👍👍
That Thunbnail though really caught me
It's from the "Ray tracing in one weekend" book
@@jarreed0 It isn't for the image itself, more for the face in the sphere🙃
Best thumbnail I’ve ever seen
15:55 - you should be able to use designated initializers (since C++20) in the initializer list to do this cleanly
moving camera has another benefit: you changes only one value instead multiple in for example case where you have triangle mesh
hope to see more of this type of videos thank you very much
My first thought for handling the naming for position was to convert the index to a string and concatenate it with "Position"
Im hyped for the triangle-ray intersection test
@@panjak323 sorry, im too stupid to learn it from paper. thats why I´m actually watching this series
Its just a ray and plane test, then you check if the intersection point of the plane is within the triangle
This series is amazing!
That thumbnail got me quite watching better caul saul even though I'm a hardcore better call sauler and breaking bader.
The hazel engine is good to work with, Thank you for making it.
Hey! Love your videos, they are so motivating and exciting, you're one of the best people I've ever known. Can you please suggest what is the best library to start from for creating program to visualize frame three-dimensional model of the body, display it on the stage with and without perspective, scale and rotate? Maybe there are some books that you would recommend, thanks so much in advance
this is definitely one of the thumbnails of all time
That car alarm, reee, had me trying to check outside.. n I cant really walk rn :D
If you really want to take your time with it, get a chunk of clay and mold it into a sphere. Then set it on some graph paper and use some analog hand calipers and measure all of the visible points on it. Then plot those in a file and write a for loop to draw each pixel to the screen. Done. 😂
finally he's here
3:10, there's a simpler way to see if it hits the object, any xy point of a hypotenuse can be normalised between 0 to 1, everyone follows that fine right? The same normalised point can be calculated with 3 lines of math on an integer angle, modulo being part of that math, once the relative xy integers are calculated just normalise them then multiply against the height & width for the actual points relative to the dimensions of the triangle, similar can be done with curves however an extra 2 lines are needed at minimum since you need to modulo the integer axis values by 3 to get the relative numbers to add to the original axis value, I'll show an example when I finish getting my trial library to a state where I can translate the math I worked out on paper to glsl.
**Edit:** Realized I forgot to mention how this applies to object hitting, you multiply the normalised values on the object dimensions to get the hit box edge hit, then you just check if the outer hit diameter falls outside half the positions calculated for simple check, for nit picky check against the vertices you just need to check their positions are all greater or equal to the halfway point, if the halfway point falls inside the inner hit diameter then the nitpick check is not needed since it's guaranteed to be a hit
I just realised there's an even simpler way to do the nit pik part, all it requires is 2 vertice "textures", 1 for where vertices of the the object fall in the z axis, the other is a lookup table for the furthest out vertice falling in that space, every thing from there is just using the nearby indices to spread the hit on the display side of things, if NaN is stored in a "pixel" of the 1st texture then no vertice happens to fall into said "pixel", and just get's ignored, as for the dimensions of said "textures" the maximum should be relative to the smallest vertice position value used, so for example if you have just 1 vertice defined as 0.1, 0.2, 0.3 etc then you'll need at most 11 "pixels", if it's 0.01, 0.02, 0.03 etc then 100 "pixels", the point is to have at most what the largest value would be if you ignored the dot plus 2 extra for 0 & 1
**Edit:** Correction, 4 "textures" minimum, I only considered from the front, which would only get one half of the vertices that need to check against, the extra 2 are the same but for the back of the model instead, there could be checks for other visible vertices if you create the same kind of "textures" for all 6 faces of the objects box, you just need adapt the checks according to the facing's axis, still faster than square rooting the ray then checking each individual vertice, better to just use lookup "textures" that are ignorant of the surrounding area since it only needs to know the ray's entry & exit points in normalised form
@@zxuiji Neat, but for simplicity's sake I would just use a rectangle around objects I want hit boxes for and make it as tight as possible to the model in question. Super fast even if it is inaccurate, and for most purposes I'd say good enough.
@@anon_y_mousse Well if you're doing ray math anyways then might as well let the physics engine lookup the vertice via the "texture" maps anyway it would probably cost at most 1 extra nanosecond instead of the flat box method
@@zxuiji If you have a ray tracing graphics card, if ray tracing is turned on, then sure. Otherwise, it's at least a good idea to know how to do both and have both as options in case the user has crappy hardware or chooses to use less power on say a laptop with limited battery life.
@@anon_y_mousse You don't need a RT enabled gfx card to do RT, the method is just slightly slower due to not having hardware built specifically for it, it's also useful for physics, RT is not solely for light, it just happens to be most prominent in light
I'm wondering how you made the thumbnail of this video? That's really cool! Are there any image tools for spherically distorting a part of the image? Please don't tell me it's rendered by adding your face as a texture on the sphere....
Photoshop..?
Thank you very much
cool thumbnail bro
I think you forgot to add this one to the playlist
"scene.Spheres.Size() == 0" could be, instead, "scene.Spheres.empty()", or I'm missing something?
I hear that you have new keyboard! Keychron? :)
Why not just write the initialisation of the Sphere like `Sphere sphere{ .Position = { 0.f, 0.f, 0.f }, .Radius = 0.5f, .Albedo = { 1.f, 0.f, 1.f }};` ?
You get the names, guaranteed the minimum amount of instructions without setting the defaults first etc.
Фотка на видео фановая)) Ян, хорошо получилось, юмор в роликах не помешает
Is Hazel 3D close source?
I think its another branch in the normal hazel repo
The actual, more advanced one is only for patreons. There is a public repo with code from the videos though
Yay
Does anyone know what VS theme he uses? And font?
Hey cherno should i also learn algebra for mathematics programming
Linear Algebra and Numerical Mathematics are really helpful. LA is all about Vectors, Matrices and the connection between geometry and algebraic equations. NM shows and proves methods to calculate solutions of equations on a computer
@@alexmathewelt7923 thanks
@@DV-ye6xb if u into RUclips lectures, "MIT Gilbert Strang Linear Algebra" is a really good source to understand basic concepts of LA
@@alexmathewelt7923 ok thank you so much
Be my guest, if you came here after watching Tom Scott's video about youtubers clapping at the beginning of a vlog.
First? Anyway ye nice vid btw explaining everything.
You rock Cherno! Also, tone your arms.
I'm not actually here to watch the video, just wanted to say I loved the thumbnail
So early...
LOL
;)
and get tNice tutorials soft out.
Frankly I think graphics programming in general should abandon the concept of a scene, all there should be is -1 to 1 of the parent area, that's all the area that need since everything will scale according to the parent scale
A scene is just a collection of nodes (such as entities) commonly put in a tree structure. I don't know why you are mentioning area about something that is just a collection of things. If I have a collection of objects in a list do you try and find out the "area" of that list? How so? Especially as lists don't have an area.
@@victorioussnake as is an object, your point?
@@zxuiji you're talking about moving away from scenes because of reasons to do with area when scenes have nothing to do with area
@@victorioussnake scene and objects are both areas filled with stuff, there is no difference
@@zxuiji no an area is a boundary of space. A list is a collection of items