Category : light

I try to add light in Three.js but when I update display, light doesn’t affect on my cilinder I literally copy pasted the source code from Three.js docs Three.js but it doesnt work, this is my code import * as THREE from "https://cdn.skypack.dev/[email protected]"; import { OrbitControls } from "https://threejsfundamentals.org/threejs/resources/threejs/r122/examples/jsm/controls/OrbitControls.js"; //scene and camera set up const ..

Read more

I want to import point lights from a .glb file into threejs. I know that I need to use the KHR_lights_punctual extension to do this however I do not really understand how to use it. This is my basic setup: renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.physicallyCorrectLights = true; renderer.outputEncoding = THREE.sRGBEncoding; ..

Read more

I was doing a ring in three.js. I’ve needed to add camera and lighting. Camera work is ok, but I’ve got the problem with lighting. Here is my code: <script src="three.js"></script> <script src="https://threejs.org/examples/js/controls/OrbitControls.js"></script> <script src="https://threejsfundamentals.org/threejs/../3rdparty/dat.gui.module.js"></script> <script> const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); const renderer ..

Read more