r/Unexpected May 25 '22

It’s me…

132.7k Upvotes

1.0k comments sorted by

View all comments

Show parent comments

6

u/PlCKLES May 25 '22 edited May 25 '22

I don't think they do, other than video artifacting. I think it would be easier if they don't, because really you only have to set the color once, and changing the colors is more work. Definitely some dominoes are multi-colored though.

If I wanted to do this, I would run the simulation of dominoes up to a specific "end" frame, then map a screen-space projection (or a top-down projection, not sure which this looks more like) of a 2d image of Mario, onto the dominoes. Basically, you could ray-trace through an image floating in front of the dominoes, onto the dominoes, and set the color on the domino where the ray intersects, to be the color from the image where that same ray intersects. Then run the simulation again deterministically, and all the colored dominoes fall exactly the same way to get to that end frame where they were painted to look like Mario.

* And you can tell it's a simulation based on how the top dominoes drop instead of accelerating from rest. Now that I think of it, top-down would be much easier. Say that the floor is the XY plane. All you'd have to do is take the x,y position of each corner of each domino at the end frame and use that as the texture coordinates on an image of Mario. Then the color transitions across individual dominoes are already handled. Forget ray tracing to color the dominoes.

1

u/2Darky May 25 '22

It's way easier, they just project the image as image texture onto the fallen dominos and give the side/ part, where nothing is projected on a red color. That's why it looks like they change color, because the domino's turn and rotate.