Mihails Akimenko
Mihails Akimenko

Reputation: 104

Three.js BufferedGeometry VertexColors

https://jsfiddle.net/Mihails/uko6dzwj

   var colors = new Float32Array([
   // All Ok with green color:
    0, 250, 0,
    0, 250, 0,
    0, 250, 0,

   // Issue is here. Why color is not magenta?
    249,149,249,
    249,149,249,
    249,149,249,
  ]);

Scene has BufferedGeometry (plane in the middle has 2 triangles):

Why second triangle has a wrong color? Where I did a mistake?

Upvotes: 1

Views: 85

Answers (1)

WestLangley
WestLangley

Reputation: 104833

Colors take values in the range [ 0, 1 ] in three.js -- not [ 0, 255 ].

three.js r.77

Upvotes: 2

Related Questions