|
@@ -2,6 +2,7 @@ import { LineSegments } from '../objects/LineSegments.js';
|
|
|
import { LineBasicMaterial } from '../materials/LineBasicMaterial.js';
|
|
|
import { Float32BufferAttribute } from '../core/BufferAttribute.js';
|
|
|
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
|
+import { Color } from '../math/Color.js';
|
|
|
|
|
|
class AxesHelper extends LineSegments {
|
|
|
|
|
@@ -31,6 +32,29 @@ class AxesHelper extends LineSegments {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ setColors( xAxisColor, yAxisColor, zAxisColor ) {
|
|
|
+
|
|
|
+ const color = new Color();
|
|
|
+ const array = this.geometry.attributes.color.array;
|
|
|
+
|
|
|
+ color.set( xAxisColor );
|
|
|
+ color.toArray( array, 0 );
|
|
|
+ color.toArray( array, 3 );
|
|
|
+
|
|
|
+ color.set( yAxisColor );
|
|
|
+ color.toArray( array, 6 );
|
|
|
+ color.toArray( array, 9 );
|
|
|
+
|
|
|
+ color.set( zAxisColor );
|
|
|
+ color.toArray( array, 12 );
|
|
|
+ color.toArray( array, 15 );
|
|
|
+
|
|
|
+ this.geometry.attributes.color.needsUpdate = true;
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
dispose() {
|
|
|
|
|
|
this.geometry.dispose();
|