Changing color of cube in three.js

前端 未结 3 827
南笙
南笙 2020-12-30 19:59

I\'m trying to change the color of a cube based on a variable. I created two cubes and I want to change their color depending on the distance between them.

The cubes

3条回答
  •  不思量自难忘°
    2020-12-30 20:09

    cube.material.color 
    

    will give you the THREE.Color object:

    Color

    which has a bunch of methods you can use to set the color.

提交回复
热议问题