I am using AxesHelper
, but I want it looks different than original one. Can we change the AxesHelper
's material?
Asked
Active
Viewed 2,631 times
3

WestLangley
- 102,557
- 10
- 276
- 276

Mhd
- 771
- 1
- 8
- 15
1 Answers
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
-
Thanks! It worked. one quick ques please. how to increase axishelper width? I want it to look thicker. – Mhd Aug 22 '17 at 20:16
-
See [this post](https://stackoverflow.com/a/41911520/1461008). Also see [this](https://github.com/mrdoob/three.js/pull/11349). – WestLangley Aug 23 '17 at 02:42
-
@WestLangley was working with Three.js r.94 the color are not changing with the above changes – deepak thomas Jul 25 '18 at 08:16
-
@deepakthomas Thanks. Updated post. – WestLangley Jul 25 '18 at 14:43