Triangles not using the correct color in 3d

I made a 3D graph that creates randomly generated noise. The points for this noise use the correct grayscale colors, but the triangles do not. I’m not sure why since they are using the same custom color. How can I fix this? How can I make the triangles use the correct coloring?

[my project]


This is really nice … congrats!
I didn’t find the error but are you sure the triangles and the points get scanned in the same order … because otherwise the colors do not match.

For example: why does x_0 only run over the values [1…n^{2}-n]?
I imagine this is to skip the first row of points and start building the triangles thereafter … but doesn’t this desync the colors?

Edit:
Yes the colors get desynced because there are n points per row but there are n-1 triangles per row …

1 Like

ok, this solves the problem and it is much more readable …
the problem was that you cannot skip points because otherwise the colors are out of phase …

1 Like

this is even cleaner:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.