With estrogen help or not, I have finally understood how perspective projection camera works. Before taking estrogen I had bug where camera appeared to be glued to a "selfie stick" centered at camera's coords, instead of the viewport itself being there. I had really hard time understanding why it is so, because I position the screen center right at the camera's XYZ.
What went over my testosterone filled head is that camera's XYZ should be the position of the focus, instead of the screen center. It is strange how I suddenly realized it with subconscious intuition, without following any reasoning process.
Of course for the graphics programmers out there, that is a rather newbie mistake, but I have never before in my life did any half serious 3d graphics programming with dynamic camera. I had did a software rasterizing system, before doing voxels, but it had fixed camera.
Anyway, to describe camera, I decided to just use the world matrix as-is (before that I described camera with crazy rotations + distance system). I have also suddenly realized that 3d matrix is just a set of 3 vectors, and the right way to multiply a vector by a matrix is by doing dot products with each respective matrix's basis vector. Now matrix by matrix multiplication is is a multiplication of one matrix's basis vectors by another one's basis vectors. And it should be see precisely as vector being multiplied by a matrix and not the other way around, because matrix there acts as a function moving vector from one space to another. Surprisingly all linear algebra tutorials miss that, instead describing matrix as a 2d table (instead of an array of vectors), while multiplication as this opaque element by element operation, which tells you nothing about what truly happens.
Guess now I can properly understand these neural networks tutorials, which are heavy on matrices.
Current Mood:
accomplished