Hi,
First of all, really excited to be here in Alpha testing and finally see the POPs in action. Trully incredible addition and now I can see how useful and far fetching is it gonna be.
So… while poking around the examples and playing with POPs, I wanted to implement some Kinect point cloud to POP sketches, even managed to convert point cloud rows to linestrips and lines, but couldn’t find an easy way to convert them to quads. I found the information that its not yet supported, so I started to think about low level solutions (GLSL Create). Are there any resources on how should I proceed?
I basically think about such scenario:
1 we start with set (L) of N lines, corresponding to pixel rows from top
2 for each line,
2a we create a copy (LT) by transforming it by vector T
2b create N number of quads, between corresponging (by index?) segments (lines),
I managed to do until 2a in Pops (with dimensions Nx2) but not sure how to do point 2b
One proposed solution would be to create a new POP with intertwined series of points (sequence: L1, L2, LT1, LT2, L3, L4, LT3, LT4,…) and use a PrimitivePOP to create quads with every 4 points option.
Could anyone help me and tell how do I intertwine 2 PoPs (L, LT) like this?
I think GLSL Create should be what I’m looking for, but I couldn’t find much info on it and how to glsl code POPs into existence.
Or maybe I’m missing something really basic?
You are part way there. You can use the Primitive POP but need to get the points in an order where you can just connect every set of 4 point together.
The Sort POP is useful in this, but you need an attribute to sort on. In this example we take 2 100-point grids (the second grid is a transformed first grid) and merge them together. In this state we would want to connect these points to make the first two quads:
0 1 101 100
2 3 103 102
etc
We create an attribute on the first POP called Sorter which is simply the point index: 0, 1, 2, 3…
On the second POP we also create an attribute Sorter but we want its values to be shifted a bit, so when sorted, the first 2 points of the first grid are after the first 2 points of the second grid but reversed. So the Math Mix makes its values (edit) 1.2, 1.1, 3.2, 3.1 using mod() and some arithmetic.
Then we merge the two grids, and then we sort on the Sorter attribute giving the first 8 points with sorter values:
0, 1, 1.1, 1.2, 2, 3, 3.1, 3.2 …
Then we pass the result to a Primitive POP that does the sequential connecting.
This trick of sorting gives you great flexibility in how you connect points together in general. Happy sorting dreams.
Thank you very much, Greg! Your solution is so elegant and simple… Converting the point index to float on and adding the fractions to inject the transformed points works great. Additional thanks for including the .tox - it helped me a lot - also to understand the Math Mix POP operator. It’s pretty powerfull add in Alpha!
Thanks for your question @boros and your guiding answer @greg, had a different question about modulating connectivity that finds it’s footing in the same answer.
Utmostly excited after the first few hours testing the POP paradigm.
Turns out that Greg’s solution was producing every 2nd quad, so I’ve created additional N+1 pass and compressed the index range per quad, so it can fit nicely in original numbering
Here’s a modified .tox for line to quads linesToQuads.tox (11.0 KB)