Selective Per-Instance Horizontal Flip for Triangular Grid

Hi everyone,

I’m working on a grid of triangles in TouchDesigner, where each triangle is instanced at points generated from a grid. My goal is to flip the triangles horizontally at every other point, based on their position in the grid. Specifically:

  1. The grid is structured into rows of 60 points.
  2. Every other point in a row (e.g., points 1, 3, 5, …) needs to have a horizontally flipped triangle.
  3. Every other row alternates this pattern (e.g., rows 0, 2, 4 start with unflipped, rows 1, 3, 5 start with flipped).

I’ve already:

  • Grouped points into two groups (GroupA and GroupB) based on the alternating pattern.
  • Fed the grid points into a Geometry COMP for instancing but can’t apply the flip correctly on a per-instance basis.

The main issue:

  • When I use a Transform SOP to flip, it applies the transformation to all points in the group as a whole, not on a per-point basis.

Is there a way to assign a custom attribute (scaleX) or another approach to dynamically control the horizontal flip for each triangle instance? I am trying to avoid creating a grid that it too irregular because I am driving other Instance values via a an input video.

Any guidance on correctly setting up the Attribute Create SOP, or another efficient solution, would be greatly appreciated!

Thanks in advance for your help!

Hello,
Using the index of each vertex, you can
– made a pattern with the right length, alterning rotation angle and used in the rotation OP
– use a geometry shader (or perhaps a vertex shader) to rotate each instance based on instance ID
Not on my computer to propose an example :frowning: