Three.js - Getting a low poly image

I am trying to create a low poly style terrain, for reference, this style:

By this I mean that each triangular is one shade.

When I try something like this, the shading is very smooth. Here's an example with several triangulars:


(source: willdonohoe.com )

I also tried adding drop shadows, but that also didn't give the desired effect. Here's a shot with lots of triangulars with shadows added:


(source: willdonohoe.com )

Looking at Three's documentation, the shading property in the material class sounds like it would work, but THREE.FlatShading and THREE.NoShading don't seem to have any effect.

Is there a special technique I need to use to create this effect? Any direction you can point me to would be much appreciated.

You can find my first demo here

Many thanks,

Will be

+3


source to share


1 answer


EDIT: This answer is out of date. Update:

material.shading = THREE.FlatShading

now material.flatShading = true

.

You have changed the positions of your vertices PlaneGeometry

.

To create flat shading with MeshLambertMaterial

, you have to update your normals by calling



geometry.computeFlatVertexNormals();

      

For other materials, just fit just material.flatShading = true

enough to get a flat look.

three.js r.87

+7


source







All Articles