Apply color gradient to material on mesh - three.js
问题 I have an STL file loaded into my scene with a single colour applied to a phong material I'd like a way of applying two colours to this mesh's material with a gradient effect applied on the Z axis a like the example below.Gradient Vase]1 I have a feeling I may have to introduce shaders but I've not gotten this far with three.js. 回答1: Simple gradient shader, based on uvs: var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(60, 1, 1, 1000); camera.position.set(13, 25, 38);