4 ms·
This is really cool. I immediately saw (t%w, t%h) for wraparound (it's neat how the cycles interact). The bouncing, as he says, seems trickier. I thought about
by hyperthesis 4y ago
This is really cool. I immediately saw (t%w, t%h) for wraparound (it's neat how the cycles interact). The bouncing, as he says, seems trickier. I thought about a 2w x 2h box, but stopped there.
His suggestion of starting with 1D was great, made it much easier to think about! I drew a graph of x against t, and worked out |t%(2w) - w| (starts rightmost) Can use absolute value, no need for ternary op. (In hindsight, graphing y against t would be easier to visualize.)
I'm always amazed at how cartesian coordinates are independent (despite being so by definition). Descartes deserves more credit for this eponymous fundamental insight.
For those thinking "simulation without state" (aka "procedural") only works for simple simulations, how about an ocean? The Technical Art of Sea of Thieves https://youtube.com/watch?v=y9BOz2dFZzs https://youtube.com/watch?v=y9BOz2dFZzs SIGGRAPH https://history.siggraph.org/learning/the-technical-art-of-sea-of-thieves-by-nakamura-and-hashimoto/ https://history.siggraph.org/learning/the-technical-art-of-s...
It's based on Simulating Ocean Water (Tessendorf 2001).
They do a similar thing with ropes drooping correctly, though it's really crazy the numerical approach they developed. Those guys are really smart.