Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elegant matrix digital rain effect for walls #140

Open
5 of 6 tasks
552020 opened this issue Feb 9, 2024 · 3 comments
Open
5 of 6 tasks

elegant matrix digital rain effect for walls #140

552020 opened this issue Feb 9, 2024 · 3 comments

Comments

@552020
Copy link
Collaborator

552020 commented Feb 9, 2024

When I was in Wolsburg for the Winterfest I saw a cub3D, in Matrix like scenario, with the walls having falls of binary numbers black on green. I'm trying now to reproduce that, starting with some experiments outside the project just to get familiar with the mlx functions, cuase I don't know them at all. If you @lmangall by chance read this and you think I can focus on more serious issue please just tell.

  • display an image.
  • display two images one with random pixels, another with a pattern
  • display three images, the two before and an image from a png (resizing it to the dimension with the forbidden function). The original PNG is something like 1024 x 1024, the box in the window 200 x 150.
  • display 4 images: the three before, plus the PNG image, but cropping it applying a background on it with a transparent window. We will see only a portion of the image and we learn about z values. These will imply creating two images, 4a, the background and 4b the actual image. MLX assign a progressive z-index to every instance of an image created starting from 0, we will assign to the background -1 and to the image -2. This 'cropping' strategy seems to be called 'clipping' https://en.wikipedia.org/wiki/Clipping_(computer_graphics)
  • display 5 images, the 4 before plus achieve the same result as in 4 but with a real crop. Changing the size of the image and remove the not necessary pixel. We have two possible strategy to achieve this cropping the 'texture' the mlx_texture_t thing or the mlx_image_t thing. The model says that if we don't need the whole image later, then the best approach is just to crop the texture.
  • display 6 images: the 5 before plus now finally the matrix-like falling code image. It should move ...
image image

In this example it's more clear that the image has been centered. Worth noting that the original image with the resize function being 961 x 431 px got a little bit squeezed

image

The result is the same the the 5th image is done through a "manual" crop, which is pretty impressive. Really interesting exercide to get what this textures and images are

image

Resources

@552020 552020 added question Further information is requested 🌷 What a Wonderful World 🌷 labels Feb 9, 2024
@552020 552020 self-assigned this Feb 9, 2024
@lmangall
Copy link
Owner

lmangall commented Feb 9, 2024

There are indeed "clipping masks" in software like Illustrator or Photoshop.

If you @lmangall by chance read this and you think I can focus on more serious issue please just tell.
I think you are compensating for the speed we almost finish this project at

I suppose if it is animated it is not an image per se, but I also suppose it is easy to loop through a series of images creating the illusion of an animation. Thinking of it this way I even think we could introduce it in our cub3d : 3 images (or 20) per wall as instance, the code alterning between them. I think something like Escher work would be great for this, more elegant than a matrix. Just B&W illusions, or simple things like a "spiraling spiral"...

@552020
Copy link
Collaborator Author

552020 commented Feb 9, 2024

I had the same thought about it. About the fact that at that point they are not textures anymore. Even if it is possible to reproduce the effect, letting a texture sliding down and you coule have a second instance of the texture (or better a second instance of the image) following the first instance.

The other way like generating the imagine starting only with the png of the characters or creating them with code, then would not include starting textures at all. But the problems intrigues me and start actually already to hurt a little bit cause I'm a little bit stuck. I've discovered that this effect has also a Wiki page: https://en.wikipedia.org/wiki/Matrix_digital_rain#:~:text=Matrix%20digital%20rain%2C%20or%20Matrix,on%20screen%20by%20kinetic%20typography.

I think something like Escher work would be great for this, more elegant than a matrix. Just B&W illusions, or simple things like a "spiraling spiral"...

My matrix is elegant!

@552020 552020 changed the title matrix-like walls elegant matrix digital rain effect for walls Feb 9, 2024
@lmangall
Copy link
Owner

The nice thing with the matrix code rain is that in an semi abstract way it could represent the way the pixels are rendered from top to bottom...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants