How to get the index in jit.gen in Jitter
DaSheng Hen
5月 17 2024 | 10:04 午前
I am new to max and have some experience with p5js, but it is still difficult to understand the logic of max. After seeing Generative Geometry - Max/MSP Tutorial video of implementing p5js in max, I also want to try it.
I also saw the project Nature of Node, which implements the algorithms in Nature Of Code (p5js) through other tools, including max.
I encountered a problem when trying to implement Nature Of Code - Examples 2 with max. I don't know how to get the index value in jit.gen like the index in the for loop. I have been troubled by this problem since last night.
I think this method is very suitable for beginners to understand the logic and mechanism of max. This is my patch. Please tell me how to understand this problem. Thank you very much for your help!
DaSheng Hen
5月 17 2024 | 3:05 午後
Maybe my question is too complicated, this is a simple explanation.
Now I can control the y-axis position of all points through pos_y. How can I achieve this if I only want it to affect the y-axis position of a certain point? The method I can think of now is to find one of the points through the index value (such as points[2]), but I don’t know how to implement this method in max. Thank you very much for your help!
Rob Ramirez
5月 17 2024 | 3:32 午後
you can use the cell operator in gen to get the cell coordinates of a particular vertex and then compare that to some value set by parameter to decide if the offset should be applied or not
DaSheng Hen
5月 17 2024 | 4:59 午後
Hi ROB RAMIREZ, nice to see you again, thanks a lot.
This solved my problem, but it takes me a while to understand the logic, I will update here with my next work!