Live data from Hacker News

Show HN: Visualizing the math that powers 3D character animation

diegomacario.github.io

41–50 of 55 posts

Re: Show HN: Visualizing the math that powers 3D character animation

#41

Earlier quoted context omitted.

Despite using firefox and wantind cross browser projects I think the learning involved in browser compatibility is a LOT less interesting then about the math behind animation.

If one cannot take valid criticism when posting publicly their pet projects, then don't post publicly.

You won’t find many people who consider this “valid” criticism. This is a pet project for educational purposes and you’re complaining because they’re not equivalently efficient on every platform.

Re: Show HN: Visualizing the math that powers 3D character animation

#42
post #4

On the subject of quaternions, here is an article that pops up on HN from time to time. https://marctenbosch.com/quaternions/ It is called "Let's remove Quaternions from every 3D Engine". The author suggests replacing quaternions with rotors and geometric algebra. In 3D, the formulas are essentially the same, but framed differently. It makes some "surprising" properties more intuitive and is extensible to any number…

Wow that's fascinating, thanks for sharing it! Although I disagree with how the author describes quaternions as black boxes. The two questions he asks: - Why does i2=j2=k2=−1 and ij=k? - Why do we take a vector and upgrade it to an "imaginary" vector in order to transform it, like q(xi+yj+zk)q∗? Are clearly explained in these interactive videos created by Grant Sanderson and Ben Eater: https://eater.net/quaternions A…

yeah, those videos are opaque, too.

if you already understand quaternions, then they're apparently excellent; everyone who understands quaternions recommends them.

I don't understand quaternions. I do not understand videos which attempt to explain them. I've seen them all a dozen times each.

Re: Show HN: Visualizing the math that powers 3D character animation

#43

Cool project! AFAIK many games are using 3x4 bone matrices instead of 4x4. These matrices don't need projection component anyway i.e. 3x4 is enough. This saves some bandwidth updating the constant buffer with them, also takes slightly less math instructions in the vertex shader.

hmmm nice optimisation, might borrow that one!

Re: Show HN: Visualizing the math that powers 3D character animation

#44
post #4

On the subject of quaternions, here is an article that pops up on HN from time to time. https://marctenbosch.com/quaternions/ It is called "Let's remove Quaternions from every 3D Engine". The author suggests replacing quaternions with rotors and geometric algebra. In 3D, the formulas are essentially the same, but framed differently. It makes some "surprising" properties more intuitive and is extensible to any number…

The author also made 4D-Toys which I suppose was a proving ground for the more ambitious game project. If you have PCVR it's a good way to stretch your imagination.

Re: Show HN: Visualizing the math that powers 3D character animation

#45
post #4

On the subject of quaternions, here is an article that pops up on HN from time to time. https://marctenbosch.com/quaternions/ It is called "Let's remove Quaternions from every 3D Engine". The author suggests replacing quaternions with rotors and geometric algebra. In 3D, the formulas are essentially the same, but framed differently. It makes some "surprising" properties more intuitive and is extensible to any number…

Thanks for sharing - have stumbled over the term "geometric algebra" a couple of times, but this article made it click for me.

I completely agree with the sentiment that the algebraic mumbo jumbo often used to introduce quaternions is not very satisfying. Fortunately, as quantum computing becomes a mainstream topic, more people will have to learn about "Rotations on the Bloch sphere" [0] -- and then quaternions and rotations actually make sense.

[0] https://en.wikipedia.org/wiki/Bloch_sphere#Rotations_about_a...

Re: Show HN: Visualizing the math that powers 3D character animation

#46
post #29

I'm a little confused about why the curves are "sampled" to update the joint transformations: ``` So if we are rendering 60 frames per second, we are basically doing the following 60 times a second: Sample all the curves you see on the graphs to get the orientation of each joint... ``` When the curves are "sampled", does that mean in a 60 fps animation, there are 60 timestep values t={t1, t2, ... t60} sampled from a…

Sorry for the confusion. Your second statement is correct. Sampling just means to evaluate the function at an appropriate t value. I will update the README to make this clearer.

Re: Show HN: Visualizing the math that powers 3D character animation

#47
post #23

Earlier quoted context omitted.

GA is more general than (and superior to) quaternions (the even subalgebra of G3). However, it requires a powerful type system and compiler to compile general GA expressions to something as efficient as quaternions. C++ won't cut it. You might be able to get clever by defining a special numerically indexed type for Gn or its even subalgebras; C++ could probably do that. But it wouldn't be as nice as fully generic GA.

What do you mean by powerful type system and compiler? Do you mean an optimizing compiler that can eliminate the redundant zero terms when multiplying multivectors with many zero grades?

Correct. Quaternions have 4 elements and a small number of multiplications. G3 has 8 elements and more multiplications. This gets worse quickly in higher dimensions.

Re: Show HN: Visualizing the math that powers 3D character animation

#48
post #38
post #23

Earlier quoted context omitted.

GA is more general than (and superior to) quaternions (the even subalgebra of G3). However, it requires a powerful type system and compiler to compile general GA expressions to something as efficient as quaternions. C++ won't cut it. You might be able to get clever by defining a special numerically indexed type for Gn or its even subalgebras; C++ could probably do that. But it wouldn't be as nice as fully generic GA.

for general GA yes but for the GA needed to replace quaternions in 3D? I'm far from good at math but the GA article linked above has this comparision of quaternion code vs rotor (GA) code https://marctenbosch.com/quaternions/code.htm

Operations in G3 have a bunch of extra work compared to operations on quaternions alone due to the presence of odd grades. However, if your values are quaternionic, these grades should always be zero, so you can safely elide the operations. The compiler just has to be smart enough to see this.

The basis of G3 is 1,x,y,z,xy,xz,yz,xyz. Quaternions only have 1,xy,xz,yz. Quaternion multiplications are closed; xyyz = xz, xyxz = -yz, xzyz = -xy. xyxy=-1. If your compiler is smart enough to figure out that x,y,z,xyz are always zero, you can save the extraneous operations.

Re: Show HN: Visualizing the math that powers 3D character animation

#49
post #29

I'm a little confused about why the curves are "sampled" to update the joint transformations: ``` So if we are rendering 60 frames per second, we are basically doing the following 60 times a second: Sample all the curves you see on the graphs to get the orientation of each joint... ``` When the curves are "sampled", does that mean in a 60 fps animation, there are 60 timestep values t={t1, t2, ... t60} sampled from a…

https://en.wikipedia.org/wiki/Sampling_(signal_processing)

This definition clears up it up nicely for me:

"In signal processing, sampling is the reduction of a continuous-time signal to a discrete-time signal... A sample is a value of the signal at a point in time and/or space; this definition differs from the usage in statistics, which refers to a set of such values."

So it's a sample in the sense a set of (x, y, z, w) values from discrete timesteps represents a continuous timestep, but doesn't require specifying and using random variables to determine those timesteps.

Re: Show HN: Visualizing the math that powers 3D character animation

#50

Earlier quoted context omitted.

Despite using firefox and wantind cross browser projects I think the learning involved in browser compatibility is a LOT less interesting then about the math behind animation.

If one cannot take valid criticism when posting publicly their pet projects, then don't post publicly.

@dylan604 That sentence can be applied as well to your own opinion about wide browser compatibility.
Post reply on HN