Hi, I’m using p5js to draw some 3D triangles. For each triangle I have a color defined at each vertex and I would like to see a smooth interpolation of the color using the typical barycentric interpolation across the triangle. I’m trying to do this as follows:
beginShape(); fill(color1); vertex(x1, y1, z1); fill(color2); vertex(x2, y2, z2); fill(color3); vertex(x3, y3, z3); endShape();
This is drawing each triangle with a solid flat color instead of an interpolated color. Is there something I’m missing?