4 ms·
What sort of 3D animation do you want to do? If you're talking about shaders, you might be doing yourself a disservice with the bottom-up approach. In my opini
by dorkwood 5y ago
What sort of 3D animation do you want to do? If you're talking about shaders, you might be doing yourself a disservice with the bottom-up approach.
In my opinion, learning to use math functions as tools rather than having a deep understanding of how they work is an equally valid approach. I know several great WebGL developers who really aren't very good at math.
Consider the following definitions of the dot product:
A) Algebraically, the dot product is the sum of the products of the corresponding entries of the two sequences of numbers. Geometrically, it is the product of the Euclidean magnitudes of the two vectors and the cosine of the angle between them. These definitions are equivalent when using Cartesian coordinates. In modern geometry, Euclidean spaces are often defined by using vector spaces. In this case, the dot product is used for defining lengths (the length of a vector is the square root of the dot product of the vector by itself) and angles (the cosine of the angle of two vectors is the quotient of their dot product by the product of their lengths).
or
B) The dot product takes two vectors as inputs, and returns a value of 1.0 if they're pointing the same direction, -1.0 if they're pointing in opposite directions, and 0.0 if they're perpendicular (as long as they're unit vectors of equal length). This function can be used for diffuse lighting calculations (i.e. is the light direction facing the same way as the surface?), checking if a point is in front of another point, etc.
In my opinion, the second definition is much more useful for someone interested in 3D on the web, but it's something you won't find in math textbooks.
- wizzwizz4 5y ago(The second definition is also wrong – it's true only for unit vectors.)
- jimbob45 5y agoIf you express your vectors as scalar multiples of unit vectors, it works, right?
- Jensson 5y agoThen you'd still multiply those scalars. In your example you just replace 1 and -1 with the product of the vectors length.
- dorkwood 5y agoThat's why I wrote "as long as they're unit vectors" in my definition.
- imbnwa 5y ago> What sort of 3D animation do you want to do? This is perhaps where I go wrong, as I assume it's 'all the same thing'. I currently work on a web app that provides an editing interface for 2D animation with DOM objects (so, rectangles), so I have a notion of using matrices for camera transforms but the extension into 3D animation seems like another planet. I get what you're saying with the tool perspective, but I'm usually nervous about "how do I fix something if something breaks". In the past when I've spoken of what I work on with friends of friends who're professionals in other fields, and I'd frequently be asked about my 3D animation skills as they had some business idea they wanted to execute on. This experience was primarily my motivation to looking further into 3D rather than say gaming so gun to my head 3D modeling and editing would be the first stop. But the comments here have been helpful
- jmchuster 5y agoSo, it seems to me that if you already do 2D animation, then figuring out 3D should be something you almost think of as guaranteed. Like it's inevitable that you'd get it right if you put in the time, and then you just make some estimate of like, hmm, maybe 6 months, maybe 3 months, but I'm sure to have figured it out by then. But I also think that this mindset is something that needs to be learned. Maybe it can only be learned by successfully achieving enough new skills adjacent to things you know. So doing so lets you gain the confidence you'll always figure it out given enough time, and then also maybe gives you a kind of mental pattern of ways to successfully do so.