     EndPrimitive();
     if (hasTwoTriangles)
     {
-      justEmit(pos, color);
+      justEmit(matrix, pos);
       ++emittedVertexCount;
     }
   }

      addCutPositionIfNew(newPos);
      //vec4 c = newPos * 0.5f + vec4(0.5, 0.5f, 0.5f, 0);
      // c.a = 0.5f;
      emittedVertexCount = emit(matrix * newPos, c, emittedVertexCount);  // vec4(1, 1, 0, 1));
    }
  }

  if (emittedVertexCount == 5)
  {
    emit(firstPosition, c, emittedVertexCount);
  }

  EndPrimitive();

    bool isPosInFOV = dot(inPos, plane) > cutOffZ;
    if (isPosInFOV)
    {
      emittedVertexCount = emit(matrix, inPos, emittedVertexCount);
    }
    vec4 nextPos = triangle[(i + 1) % 3];
    bool isNextPosInFOV = dot(nextPos, plane) > cutOffZ;
