Ronze
Ronze

Reputation: 1574

Three.js gradient across multiple faces

I'm trying to build a HSV cylinder in three.js, and I'm having a hard time mapping the gradient to the faces. I thought that I could just create my object like this:

Wireframe

However, the gradients – especially on the red quad going downwards – do not look smooth. It makes sense, but I don't know how to fix it.

Real

I really just want to create a quad and specify the corner vertex colors, but Face4 is gone, and all examples use this.

Is there any way to create a gradient that goes across a rectangular face (or combinations of faces)? How do I need to think about gradients that need to run over multiple faces?

Upvotes: 1

Views: 445

Answers (1)

Ronze
Ronze

Reputation: 1574

"More triangles" seems to be the answer here.

enter image description here

enter image description here

Upvotes: 1

Related Questions