Three.js - MeshBasicMaterial



It is the very basic material in Three.js. It is used to create and display objects of solid color or wireframe. It is self-illuminating and is not affected by lighting.

const geometry = new THREE.BoxGeometry(2, 2, 2)
const material = new THREE.MeshBasicMaterial({
   color: 0x87ceeb,
   wireframe: true,
   wireframeLinewidth: 2,
})
const cube = new THREE.Mesh(geometry, material)

Sometimes it’s hard to distinguish between two adjacent surfaces of the same color. If you create a sphere, it appears like a 2D circle. Although it seems 2D, it should be 3D.

threejs_materials.htm
Advertisements