ThreeJS Match GLTF Model To Size Of Bounding Box

I want to scale the imported GLB Model to the same size a cube in my scene. It is needed to make sure that the model stays inside the shadow casting areas and is big enough to make the shadows visible….

Three.js Materials are reversed depending on direction of view

I am using Three.js to model a home. The idea is that I can show the home to an architect and discuss it further. The project is supposed to be walkable, so I put together it all on this site. If you …

Three.JS: Move 3D cube with accelerometer data over x an y-axis

Following my previous post I am developing a 3D model that moves based on input from accelerometer and gyroscope sensors. The 3D model is written with three.js, and the input data for rotation and …

(Three.JS) How to loop/lerp through more than two colors (three colors)?

I’m working on a project in the Three.JS Online Editor. I’m trying to make a Day / Night Cycle. It should loop through colors, setting the scene background colors, like this: Day Sunrise/Sunset Night …

Three.js – Model cannot receive any shadow

I’m currently new and learning about three.js. And i’m using react-three-fiber to make it happen with React, but i stumbled upon a problem. The model however, cannot receive any shadow from another …

Raycaster do not stays in center when i am updating camera

guys i have a problem with Raycasting and i couldn’t find solution so far. What i am trying to archieve is that, i want Raycaster to stay always in center, like when i move my camera and look other …

How to create WebGL 2 renderer in iOS?

I am trying to create a THREE.WebGLRenderer, but it seems that on iOS, it will only create a WebGL 1. Here is my code for creating the renderer and printing the capability: var renderer = new THREE….

Javascript / Three.js is not working in https

I recently switched my http site to https. Since I made this change, one of my projects no longer works. In this random generator, the background using the Three.js library does not appear when the …

Clipping geometry made from merged faces, stenciled cap face not aligning properly

My project uses geometry where each face is its own mesh. I need to clip the geometry to cut away a portion of it and have a stenciled cap face cover the clipped edges. I examined and tinkered with …

(Three.js) How to slowly rotate a mesh until it reaches a specific value

I’ve just gotten into Three.JS, and I’ve ran into an issue. I’m trying to make a car, that is drivable using the Arrow Keys. So far, I’ve gotten it to move forwards, and backwards, and the wheels turn …