Rain of code

   1384   2   0
User Avatar
Member
10 posts
Joined: 9月 2021
Offline
Hey guys!,

I am trying to follow this tutorial of a code/characters raining matrix effect. I would like to tweak it and create a line of text (the word "Dystopia" instead of random chracters; meaning that each point would first create the letter "D", then "Y", and so forth and create the rain effect of many words saying "Dystopia". I tried to tweak this line of code (from the attached image) but I am by no means experienced in coding and I am not sure what I am doing. If someone could help me out with the code or point me in the right direction it would be very much appreciated. Thank you for your time!!

https://www.youtube.com/watch?v=0k9HMpUq2bk [www.youtube.com]
Edited by Manarias - 2022年11月4日 14:42:12

Attachments:
C__Users_jogon_Desktop_Transition_RAINTRANSITIONS.hipnc - Houdini Apprentice Non-Commercial 19.5.403 - Py3.9 04_11_2022 18_14_27.png (2.4 MB)
RAINTRANSITIONS.hipnc (321.4 KB)

User Avatar
Member
2625 posts
Joined: 6月 2008
Offline
You could try something like this to replace your s@character generation vop.
You'll want to reduce your particle Life Expectancy from 100 seconds to something lower like 4 seconds. Life Expectancy controls speed of character change with this setup. To make the strands change at different rates, try a non-zero value for Life Variance on the popsource1 node.

Place this code in a point wrangle.
// Create an array of characters from a string.
string letters[] = split("D,y,s,t,o,p,i,a,",",");  
// Get array length.
int l = len(letters);                               
// Generate an index into the array based upon particle age.
int index = int(fit(@age,0,@life,0,l));
// Alter starting index randomly for each point.
int offset = int(fit01(rand(@id),0,l));
index += offset;
// Make sure index isn't longer than array length.
while(index>=l){index=-l;}
s@character = letters[index];
Edited by Enivob - 2022年11月4日 16:04:38

Attachments:
ap_RAINTRANSITIONS.hipnc (332.6 KB)
matrix_like.gif (684.3 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
10 posts
Joined: 9月 2021
Offline
YOU ARE AMAZING! Thank you!!! I can work with this))
  • Quick Links