I've been working on creating a scene with triangles in Threejs. While the BufferGeometry
has helped me shape the triangles correctly, I'm facing an issue with lighting. I've tried different materials like standard, phong, and lambert, but none seem to respond to lighting. I even attempted to compute normals using computeVertexNormals
, but it didn't solve the problem. Flatshading also didn't have any effect.
To troubleshoot, I added a spinning torus with a phong material to my scene, but it too remains unlit.
Here's the code snippet I've been working with:
import * as THREE from 'three';
import {OrbitControls} from 'three/addons/controls/OrbitControls.js';
// Rest of the code...
Here's a glimpse of the resulting scene in this GIF: https://i.sstatic.net/ZLs7T.gif