3

I am using AxesHelper, but I want it looks different than original one. Can we change the AxesHelper's material?

WestLangley
  • 102,557
  • 10
  • 276
  • 276
Mhd
  • 771
  • 1
  • 8
  • 15

1 Answers1

6

You can change the colors of AxesHelper like so:

var axes = new THREE.AxesHelper( 10 );

//reset axes colors
var colors = axes.geometry.attributes.color;

colors.setXYZ( 0, 1, 0, 0 ); // index, R, G, B
colors.setXYZ( 1, 1, 0, 0 ); // red
colors.setXYZ( 2, 0, 1, 0 );
colors.setXYZ( 3, 0, 1, 0 ); // green
colors.setXYZ( 4, 0, 0, 1 );
colors.setXYZ( 5, 0, 0, 1 ); // blue

scene.add( axes );

three.js r.94

WestLangley
  • 102,557
  • 10
  • 276
  • 276