@@ -39,20 +39,6 @@ export const createArrow = function(three, shaftLength, pointerLength, shaftRadi
39
39
return three . BufferGeometryUtils . mergeGeometries ( [ shaft , base , pointer , pointerBase ] , false )
40
40
}
41
41
42
- function setColorBuffer ( three , buffergeom , r , g , b ) {
43
- var color = toGLColor ( r , g , b )
44
- var ret = [ ]
45
- var pos = 0
46
- for ( var i = 0 ; i < buffergeom . index . count ; i ++ , pos += 3 ) {
47
- ret [ pos ] = color [ 0 ]
48
- ret [ pos + 1 ] = color [ 1 ]
49
- ret [ pos + 2 ] = color [ 2 ]
50
- }
51
- buffergeom . setAttribute ( "color" ,
52
- new three [ "BufferAttribute" ] ( new Float32Array ( ret ) , 3 ) )
53
- return buffergeom
54
- }
55
-
56
42
/**
57
43
* TODO: Not documented yet.
58
44
* @param {number } shaftLength
@@ -72,10 +58,10 @@ export const createMultiColoredArrow = function(three,shaftLength, pointerLength
72
58
const pointer = Meshes . createCylinder ( three , pointerRadius , 0 , pointerLength , slices ) ;
73
59
const base = Meshes . createDisk ( three , 0 , shaftRadius , slices , 1 , true ) ;
74
60
const pointerBase = Meshes . createDisk ( three , shaftRadius , pointerRadius , slices , 1 , true ) ;
75
- setBufferColor ( three , shaft , shaftColor ) ;
76
- setBufferColor ( three , pointer , pointerColor ) ;
77
- setBufferColor ( three , base , shaftColor ) ;
78
- setBufferColor ( three , pointerBase , pointerColor ) ;
61
+ Meshes . setColor ( three , shaft , shaftColor ) ;
62
+ Meshes . setColor ( three , pointer , pointerColor ) ;
63
+ Meshes . setColor ( three , base , shaftColor ) ;
64
+ Meshes . setColor ( three , pointerBase , pointerColor ) ;
79
65
// move the pointer base to the top of the shaft
80
66
pointerBase . applyMatrix4 ( matTo4D ( three , MathUtil . mat4translated ( 0 , 0 , shaftLength ) ) ) ;
81
67
// move the pointer to the top of the shaft
0 commit comments