3 ms·
Some 15 years ago when I was an undergraduate, I took a class in Linear Algebra. A month or whatever in we got to the chapter of transformation matrices: Rotat
by marginalia_nu 5y ago
Some 15 years ago when I was an undergraduate, I took a class in Linear Algebra. A month or whatever in we got to the chapter of transformation matrices: Rotation and translation of 3D points. I immediately saw the utility: I could make 3D graphics with these tools! I pretty much ran home and started building a first person spaceship game, pouring over the book trying to work out how to make all these bits fit together. The graphics were rudimentary, I used SDL and most stars were just white squares (SDL_FillRect), but eventually I got to the point where I could travel in "space" and have the stars zoom by.
Turns out, software matrix multiplication is not the best way of doing 3D graphics, but it's a great way of learning how the mathematics of it works. In the mean time of doing all this I had gotten linear algebra. LA was one of the first "hard" classes we took, and a lot of people barely passed. I got top grades in that class.
The moral of the story is that if you want to learn how something works, then this (what OP is doing), is correct. This is a great way to learn. There probably is a faster or better way of doing it, but in terms of learning-efficiency, this is great.
- gfxgirl 5y ago> Turns out, software matrix multiplication is not the best way of doing 3D graphics ok, what is? all the 3d engines I've ever worked with do tons of software matrix multiplication. You generally need to know where things are for collision checking and other things so doing it all on the gpu is not an option
- marginalia_nu 5y ago> You generally need to know where things are for collision checking and other things so doing it all on the gpu is not an option Sure. You can do some of it in software. That's fine. Point is I didn't use the GPU at all, and did all the rendering in software. No matter how you rotate or translate it, that's not a particularly efficient way of doing it.
- marcosdumay 5y agoAnyway, the GPU usually does it with matrix multiplications.
- Simplicitas 5y agoSo what are some of the more efficient ways of doing it, if it's not too much to ask? :-)
- marginalia_nu 5y agoTo have the GPU do the work for you. A series of calls to OpenGL is a heck of a lot easier than setting up 3x3 rotation and translation-matrices and implementing a library to do 3x1, 1x3, 3x3 matrix multiplications, scalar transformations, transpositions, calculating determinants, planar projections, perspective shifts, and what have you.
- nicwolff 5y agoQuaternions? https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotati... https://stackoverflow.com/questions/8919086/why-are-quaternions-used-for-rotations https://stackoverflow.com/questions/8919086/why-are-quaterni...
- avgcorrection 5y agoMoral of the story is that you were intrinsically motivated to learn… in which case it doesn’t matter how you learn it as long as you follow that motivation.
- marginalia_nu 5y agoIs there any other sort of motivation?
- tommek4077 5y agoExtrinsic, from the outside. For example being paid for stuff.
- marginalia_nu 5y agoRight, seems to me that's still intrinsic. The motivation somehow entering me from the outside, I still want to do the thing. (If I don't want to do it, then I'm by definition not motivated to do it)
- tonyedgecombe 5y agoThere has been plenty of research that shows a distinction. Stuff like paying kids to read books leads to them reading less over time. https://rady.ucsd.edu/faculty/directory/gneezy/pub/docs/jep_published.pdf https://rady.ucsd.edu/faculty/directory/gneezy/pub/docs/jep_...
- marginalia_nu 5y agoBehavioral economics is debunked pseudoscience.
- ghaff 5y agoIncentives are more in the vein of psychology than behavioral economics but the two fields are clearly adjacent. And this "debunked pseudoscience" led to a Nobel prize a few years ago. And many of the observations that led to this--relating to people not always being economically "rational"--are very clearly true.
- pjc50 5y agoTwenty-five years ago, slightly before I was an undergraduate, I got hold of the PC Games Programmers Encyclopedia http://bespin.org/~qz/pc-gpe/ http://bespin.org/~qz/pc-gpe/ and built myself a software renderer. You can see it on github: https://github.com/pjc50/ancient-3d-for-turboc https://github.com/pjc50/ancient-3d-for-turboc Software matrix multiplication is a perfectly reasonable way of doing 3D graphics, when you don't have a GPU. They were just starting to become a consumer product at that time: https://fabiensanglard.net/3dfx_sst1/ https://fabiensanglard.net/3dfx_sst1/
- lloeki 5y ago> The separation of talent and skill is one of the greatest misunderstood concepts for people who are trying to excel, who have dreams, who want to do things. Talent you have naturally. Skill is only developed by hours and hours and hours of beating on your craft. - Will Smith This kind of exploration, banging your head against the wall, is exactly "beating on your craft". No matter if the result is crappy by any metric, trying to wrap one's head around things and producing output - any output - over and over is oh so important. And dare I say talent without practice is useless and a waste, because one's going to stay in the comfort zone, and usually get cocky about it, whereas relentless practice teaches humility. s/art/literally anything/g in this comic: https://www.deviantart.com/scotchi/art/keep-tryin-690533685 https://www.deviantart.com/scotchi/art/keep-tryin-690533685
- marginalia_nu 5y agoThere is also an epistemological aspect to a lot of this. In school you are often taught true statements ("facts"), but that is not the same as knowledge. If I accurately predict that the next time I flip a coin, it's going to land heads; I did not know it would. I made a correct correct statement, but I did not know. Knowledge is about understanding how and why things work. That is what I was attempting to figure out about these linear algebra-operations. My classmates were attempting to retain the facts for the test, that typically doesn't work particularly well, and long term retention is poor. I've done that too. I could barely tell you what it is I'm supposed to have learned in those classes. But I could still probably construct 3D rotation matrices by hand without looking them up, all these years later.
- lostcolony 5y agoYou also had a goal beyond "pass a test", which I think is more important still. After all, Geometry isn't generally something taught or tested as merely a collection of facts (but rather their application, a la "given this, prove that", and you have to intuit a path through applying other proofs to get to the final one), and yet it still sucks as a subject in school. Because there isn't a real "why".
- novok 5y ago