5 ms·
Be acutely aware of your own knowledge level for all the concepts you're learning. There's a huge gap between knowing the name of something, being able to use
by laurieg 3y ago
Be acutely aware of your own knowledge level for all the concepts you're learning. There's a huge gap between knowing the name of something, being able to use something and being able to make something from scratch.
For example: When you start, you know what a compiler is: "It turns code into programs". Then you learn the actual nuts and bolts of using a compiler to do things. But you're still a long way from building one from scratch. Of course, building a toy compiler from scratch would be a very good project to work on as part of your studies.
This can apply to everything you're studying. As you learn more, you will learn the names of many many concepts, libraries, languages, techniques. Sometimes knowing the name and a 2 line summary will be enough, but don't confuse it with the other deeper knowledge. Make a conscious effort to pick up deeper knowledge in the areas that interest you.
- EternalCarnage 3y agoGetting the signal from the noise - A demonstration attempt (inspired by @laurieg's comment): Rendering: how to turn a virtual 3D scene into a (2D) image? Answer: (affine and perspective) geometry, usually in the form of vectors and points and some physics. (Matrices, multivectors, are structures for convenience.) The core concepts you need are: 1. Perspective projection (perspective geometry): X* = H * (X / Z) Y* = H * (Y / Z) 2. Coordinate mapping (affine geometry): MapRange(Value, Source, Target) := Value' = Scale * (Value - Source.Min) + Target.Min Scale := (Target.Max - Target.Min) / (Source.Max - Source.Min) Where Source is your "old" 2D coordinate system interval (e.g., [-1; 1] x [-1; 1]) and Target is your new coordinate system interval (e.g., [0; Width] x [0; Height]). Although, we usually have to deal with flipped y-coordinates, so: [0; Width] x [Height; 0] or for rasterization: X' = MapRange(X, Source=(-1, 1), Target=(0, Width)) Y' = MapRange(X, Source=(-1, 1), Target=(Height, 0)) ... and ray tracing: X' = MapRange(X, Source=(0, Width), Target=(-1, 1)) Y' = MapRange(Y, Source=(Height, 0), Target=(-1, 1)) 3. Containment (affine; rasterization): w := (1 - u - v), A, B, C from R2. OP = uAB + vAC + OA <=> AP = uAB + vAC <=> OP = uOB + vOC + (1 - u - v)OA <=> P = uB + vC + (1 - u - v)A = uB + vC + wA If you solve AP = uAB + vAC for u and v via Cramer's rule or by hand, you may get: A := Det(AB, AC) u := Det(AB, AP) / A v := Det(BC, BP) / A w := 1 - u - v = Det(CA, CP) / A P is inside triangle ABC, if u, v, w >= 0 and u + v + w = 1. 4. Intersection + Containment (affine): <.,.> - the dot product. t = <PlanePoint - RayOrigin, PlaneNormal> / <RayDirection, PlaneNormal> If t > 0, the line or ray intersects with the triangle's plane. X = Ray(t) = RayOrigin + t RayDirection Now, you can reuse the 2D point containment check (3), to see whether the ray intersects also the triangle (lying on that plane). --- Filtering the "noise" (overhead/information overload), getting to the "gist", for me, is not easy, but you can get there, if you care enough.