connecting points in a dodecagon
Looking for help making an adjustable patch that lets me make connections between all the 12 poles of my dodecagon. I do not need to connect to the center.
Let me know if you have any ideas for me, I tried using jit.gl.stekch but, I feel like this might be a waste of time.
Any help is greatly appreciated as always!
Cheers!
Set the draw_mode of your [jit.gl.mesh] to line_strip instead if points. And is you still want the points, make two [jit.gl.mesh] with the same input matrix.
Hey @TFL,
Thanks! do you know if i can change the destination of these lines easily? Line_strip gets me a perfect dodecagon, but I am trying to get control over the direction of each line, and maybe have multiple per pole.
Here is what I am trying to acheive:
Ah, interesting!
As usual there are different possible approaches.
If you want to rely on [jit.gl.mesh], you need to understand how the different draw_mode works, especially line or line_strip. This is something specific to OpenGL in general and you can find various examples on the web like here. Basically here you want to connect points two by two, but lines can be disconnected from each other, so the most obvious draw_mode choice would be line. Then you need to build your vertex matrix accordingly. For example if we want to draw a square between these four points:
P1(1, 1)
P2(1, -1)
P3(-1, -1)
P4(-1, 1)
We need a vertex matrix of 8 points (2 for each side of the square), organized as such:
P1 P2 P2 P3 P3 P4 P4 P1
Which will drawn the following lines: (P1 P2) (P2 P3) (P3 P4) (P4 P1) and forming our square.
The same logic can apply here, and using [crosspatch] to define the connections is a fun approach, although not so straightforward. The way I did it is
Generate and store each 12 points of your dodecagon (i did it in a matrix but a coll could be easier to deal with, or maybe just calculate the coordinates dynamically)
Dump your [crosspatch] for every change, set the vertex matrix to two times the number of connections, and set the vertex coordinates from your initial matrix in the order defined by the connections
Actually, a version based on [jit.gl.sketch] is easier to set up (here I'm generating the vertex position dynamically in gen):
But looking at the image you linked, I bet there is some kind of algorithm that would give you the correct connections based on the "hour(s)" represented in the inner circles, so we might not need [crosspatch] at all. Where does this image come from?
Thanks TFL,
like many times before, I had no idea on how to approach this, but knew what I wanted for result. The images of the hours come from the tone clock theory and I want to make an interactive patch from it. There are 12 hours and 12 different shapes corresponding to each hour (and each representing one note in the chromatic scale.
I could've done it with pictures, but, I want to add extra FX to it, so it is much better to get them in jit.gl.
The crosspatch is kinda useless, it was just a nice visual way to help me picture this whole thing. I'll be working on the patch, try to optimize some of these things. I'll be able to finish this patch soon and share it here with you!
M
Thanks for the source! I loosely read it, got inspired and came up with this.
This doesn't give you the same zodiacs as in the paper, I think you need to make your own version of [p simple_repeat] if you want the same result. My patch simply repeats the initial triad a given number of times by trying to make it fit in the 12 steps clock, but apparently there is some inversion happening in the original version (and a constant number of 4 repetitions). Anyway, it's fun to play with!
I really love your patch, I think this brings some nice new possibilities that looks great.
For my project It must look like the original zodiacs. I might've taken a few steps forward, but taken a few steps back in the process
I have most things organised, the only thing is that my approach is probably cumbersome, and i need to find a little hack for tone number 10!
have a look at what this looks like now and maybe this inspires you further :)
Thanks again for getting me out of my rut