20,888 questions
0
votes
1
answer
112
views
Loading three.js texture from UInt8Array in plugin
I'm trying to implement a three.js texture loader for the JPEG 360 format. For this purpose, it's really a JPEG image embedded in a nested set of "boxes", very similar to the structures used ...
2
votes
1
answer
113
views
Specular color has no effect on MeshPhysicalNodeMaterial
I have been trying to add specular color to my mesh. From what I understand (which could be wrong), it should add a tint to shiny/reflective areas of the surface. However, it does not seem to have any ...
2
votes
1
answer
154
views
Selective linking and hover labels .onNodeHover, .onNodeClick in Vasturiano’s 3d-force-graph
I am working with Vasco Asturiano’s incredible 3d-force-graph, and having trouble devising a proper switch command (or if/else statement) for the following:
In the following MRE, you will see that ....
Advice
1
vote
5
replies
202
views
How can I convert a 2D particle ring (Saturn-like) into a true 3D particle system?
I’m building a real-time particle system (WebGL/Canvas-based), currently rendering different formations like swarms, explosions, and a Saturn-like ring.
Right now, my “Saturn” effect is essentially a ...
1
vote
1
answer
80
views
three.js OBJLoader.js error on initialization
I'm trying to set up a very basic scene and load one obj into it. However, I keep getting this error:
Uncaught TypeError: The specifier “three” was a bare specifier, but was not remapped to anything. ...
1
vote
1
answer
209
views
Combining multiple node displays in 3d-force-graph using .nodeThreeObject
I am working on Vasturiano’s (mindblowing, spell-binding) 3d-force-graph, and having trouble combining (and separating) three seemingly very simple elements: a sprite, an image, and image text.
In ...
Tooling
0
votes
0
replies
92
views
How to improve Three.js 3D structure simulation and handle canvas resizing?
I am building a basic 3D structure simulation app using Three.js and OrbitControls. Currently, I have a simple scene with a 3D pillar and a grid helper.
The code works, but I have a few concerns ...
2
votes
1
answer
104
views
How to continue an animation after a condition statement was met in Three.js
I'm trying to create an infinite loop of objects which are moving vertically up.
The objects are grids, or walls. I plan to delete the wall as soon it goes off the camera, and then create a new wall.
...
0
votes
0
answers
98
views
Is it possible to see HTML behind a canvas where Three.js is rendered?
I made a example, here’s the link to it -
https://stackblitz.com/edit/vitejs-vite-cve3gcbr?file=package.json&terminal=dev
I tried to do this because it’s needed for this mockup.
Here’s the link to ...
0
votes
0
answers
68
views
Can't dispose MeshPhysicalMaterial
I am unable to get a MeshPhysicalMaterial to dispose correctly.
Below is a full example which shows the problem.
In the example I am using MeshPhysicalMaterial for some Mesh's in a Scene, then after 2 ...
0
votes
2
answers
152
views
javascript importmap with "THREE" and "three"
I've got javascript libraries that I'm importing and some of them refer to three.js as "THREE" and others refer to three.js as "three". I dropped in an importmap to try to clear ...
Tooling
0
votes
0
replies
66
views
How can I correctly align a 2D face image to preserve identity on a generated 3D human mesh?
I am generating a 3D human body mesh from user attributes (height, weight, gender, etc.) using a parametric model. The body is created correctly and proportions look accurate.
After that, I try to ...
1
vote
1
answer
166
views
clipping plane in threejs with different stencilRef
I need to clip an object in a ThreeJS scene using multiple clipping planes.
I used the example – it's a great example with the Depth Peeling / Stencil Volume method, but I need to do the same thing ...
3
votes
0
answers
152
views
React-three/fiber canvas only displaying when I manually alter the viewport
I've a project that takes a GLB, breaks it down into the two components and then populates a react-three/fiber canvas.
It looks great and gets fully populated by the GLB but only if I go in and ...
0
votes
0
answers
71
views
iOS: iframe inside Three.js CSS3DRenderer (CSS3DObject) won’t scroll
Problem
I’m building a Three.js scene where a laptop screen is a CSS3DObject containing an <iframe> (the iframe loads my separate React “2D OS” app). Desktop works fine, but on iOS Safari, ...
-2
votes
1
answer
230
views
THREE is not defined (latest versions)
I'm trying to get three.js working via CDN with this in my HTML as explained on their installation page
<script type="importmap">
{
"imports": {
"three": &...
Tooling
0
votes
1
replies
87
views
Implement STL flexi toy maker / add hinges to STL files programmatically
So, what I am trying to implement is STL flexi toy maker app.
The desired functionality is simple: the user uploads stl -> selects where to 'cut' (where the hinges will be) -> the model is ...
1
vote
0
answers
80
views
React-three-fiber: Cannot convert undefined or null to object (useRef)
I’m running into a strange issue with react-three-fiber that only shows up in development, but not after deploying to Vercel.
Here’s my setup:
<Canvas gl={{ antialias: true }} camera={{ position: [...
Advice
5
votes
5
replies
1k
views
what effect and math is behaind animation at antigravity google with Three.js?
How does antigravity.google create its background animation effect using Three.js, and how can I reproduce something similar (likely using math-based animations)?
I'm trying to understand how the ...
0
votes
0
answers
63
views
I can't move from panorama image to next one inside immersive web experience
Inside the VR mode, I can move from image to another I use my own fetching API.
I tried to move to the next panorama, but it is not moving inside the scene. I was trying multiple solutions, nothing ...
3
votes
1
answer
136
views
Extruding a path without the z command in Three.js
I am trying to extrude this path using Three.js ('M10,10h100v100'). You'll note there isn’t any 'z' command in the SVG file, and it is just meant to be a polyline, going right 100 and then down 100.
...
Advice
0
votes
0
replies
115
views
Webgl Threejs canvas performance optimization
Hi guys i am trying to make a website with 3d model in it and you can apply patterns designs texts stickers on the model i am doing it with canvas atlas which is every assets renders inside the oen ...
1
vote
0
answers
159
views
Keep getting error "THREE.WebGLRenderer: Context Lost" in my React Three Fiber Project
I'm making a school project for the scale of different planets and for now im making an MVP for the app.
I get no error when I remove the Slider component but when it is there it reports the error. ...
0
votes
0
answers
217
views
React Three.js: "Error creating WebGL context" even though WebGL works on https://get.webgl.org/
I'm developing a hero section for my React portfolio that includes a 3D model rendered with Three.js via @react-three/fiber.
However, when the component loads, I see this error in the browser console:
...
0
votes
0
answers
84
views
WebXR controllers for positioning in three.js
In Three.js VR I retrieve references to the controllers like the code below. There are two ways to get controller objects for 2 different purposes, buttons and positions/rotations.
controller1 is for ...
3
votes
1
answer
87
views
i uploaded a 3d model file in cloudinary and want to fetch it but when i doi it, it says: it "cannot read property 'match' of undefined"
i want to show on the screen the 3d model when i import it from cloudinary and it is succesful but the problem is that it wontshow the 3d model on the screen and the error says failed to load GLF ...
1
vote
0
answers
111
views
How to create a looping deforming Text animation
I'm trying to create an SVG animation where a shape continuously deforms (like a breathing or liquid blob).
The goal is to later place text inside the shape so that the text appears to deform along ...
0
votes
1
answer
57
views
How to get face/head direction/rotation from BVH files - Axis Studio?
I'm trying to get the direction/rotation of the head or the direction/rotation of the face from the neck.
I'm working whit a BHV file exported from Axis Studio:
Body: Axis Studio
Euler Order: XYZ
...
1
vote
0
answers
148
views
three.js: How do I wait for the <canvas> image to update for each render?
Calling renderer.render() in a requestAnimationFrame() loop will often fire faster than the <canvas> element can update its image, making any "true" FPS measurement inaccurate.
In ...
0
votes
0
answers
41
views
Camera framing problem in R3F (CameraControls + different object aspect ratios +Screens with different sizes)
I’m building a 3D website in React Three Fiber, Three.js, and @react-three/drei.
The scene is a 3d circular monument with 4 wall-mounted objects spread evenly around the monument: Mirror, ATM, Statue, ...
1
vote
0
answers
95
views
Three.js - DOF not working with point clouds (THREE.Points)
I'm trying to implement a Depth of Field (DOF) effect in a Three.js scene that includes a point cloud rendered using THREE.Points. I've based my implementation on these official examples:
https://...
1
vote
2
answers
174
views
GLSL shader not showing anything in scene in THREE.js - why?
I'm trying to make my own shader for a THREE.js project I'm working on, and I wanted to make a GLSL shader as part of it for one of the meshes in my scene. However, despite writing very basic code for ...
0
votes
1
answer
61
views
Issue with setThemingColor on groups
We're working with Forge Viewer v7 and trying to color objects based on their ID. The idea is simple: when we provide an ID, the viewer should color the corresponding objects and sub-objects.
We’ve ...
1
vote
1
answer
201
views
Why my code behave differently with transferControlToOffscreen or new OffscreenCanvas?
I’m trying to use a web-worker to render a scene with threejs. I want to render some dynamic font using a CanvasTexture. But I find that when I use canvas in web-worker from ...
-1
votes
1
answer
161
views
How to use gltfjsx to create a jsx file to load a glb file but change material colors from each call to the transformed file/model?
The best example is this sandbox
https://codesandbox.io/p/sandbox/re-using-gltfs-forked-nl2mm9?file=%2Fsrc%2FApp.js%3A18%2C1
It loads a glb model within a function that allows the properties to be ...
1
vote
0
answers
83
views
ThreeJS doesnt properly render objects those have scale(-1,-1,-1)
ThreeJS render objects reverse lighting those have scale(-1,-1,-1).
Object A has scale(1,1,1)
Object B has scale(-1,-1,-1)
the Model was exported with Sketchup as GLB format.
I tried to manipulate ...
0
votes
0
answers
113
views
Can't display texture of 3d object in three - expo react native
I am trying to load .glb object with texture into scene, and always end up fully white, like its not loaded. I can see texture exists from various .glb viewers, but here it doesn't load inside three ...
0
votes
0
answers
78
views
Why is my shader's linear map range function not smooth?
I am trying to port a Blender shader to WGSL. My plan is to port over every node I need as a WGSL function (unless the node already has an equivalent in WGSL). Currently, I am trying to create an ...
0
votes
0
answers
46
views
React Native Three - 3d player movement with camera movement simultaneously
How to mimic dual pan responders to be able to work at the same time, like left part of the screen works with movement actions, while right controls camera. I want to be able to change movement and ...
1
vote
1
answer
118
views
Cannon vehicle moving on its own
I'm implementing a 3D truck simulator and I'm facing a problem with the trailer: it moves on its own.
Here are some details and context:
The ground is perfectly flat and horizontal
The wheels have ...
-1
votes
1
answer
116
views
svg on canvas with dynamic properties
im trying draw selected svg to canvas but it is very slow, inefficient, bad resolution and not all svg's are working
and i need them svgs on canvas as dynamic(changing color, rotation and scaling)
Is ...
1
vote
0
answers
43
views
Jolt body warps away when trying to perform intake animation
I’m trying to grab a dynamic body (Object A), disable its physics, and smoothly move and rotate it into a specific holding position relative to another body (Object B). Once it’s in place, I re-enable ...
1
vote
0
answers
62
views
Issues while exporting image from a rendered scene (Three.js)
I wrote a function (a bit of vibe coding too) that exports the users current canvas as an image.
Reference Images
User’s View:
Please ignore the toolbar in the user’s view image that is not a part of ...
1
vote
1
answer
181
views
WASD controls on my three JS section not working properly making the screen glitch when moving foward
I am working in react, with a section in three.js where you can move forward with WASD and not the arrow because the arrows affect the scroll, to turn the camera, you have to drag the mouse, I have ...
0
votes
1
answer
125
views
uncaught TypeError: can't access property "elements", m is undefined in three.core.js while using three-loader-3dtiles library
I'm experiencing a runtime error when using the three-loader-3dtiles library.
"Uncaught TypeError: can't access property 'elements", m is undefined". The error occurs when I try to ...
0
votes
1
answer
114
views
GLB model appears deformed (crushed) in Three.js, but animations and skeleton load correctly
I'm working on a Three.js game using Electron, and I'm running into a strange issue when importing a GLB model exported from Blender.
When I load my model in Three.js, the mesh appears crushed on ...
0
votes
0
answers
53
views
Make shadows of an object fade as the transparency changes in THREE.js
I have a function that changes the transparency of all meshes (except one specified) in a loaded .glb object using THREE.js; according to the position of the mouse scroll. It all works well except ...
0
votes
0
answers
63
views
Unable to add physics (collision, gravity) in my A-Frame project (Quest + PC via Netlify)
I'm developing an A-Frame (HTML/JS) project for use on Meta Quest 1 and on PC via Netlify to create a simple VR escape game.
I want to add physics (collisions, gravity on objects, impassable walls) ...
0
votes
0
answers
82
views
Three.js not rendering correctly when canvas has display: none
I'm using MediaPipe to apply face blendshape scores to a 3D avatar's morph targets in Three.js.
The avatar is rendered into a custom canvas element, which is explicitly passed into WebGLRenderer like ...
0
votes
0
answers
53
views
Error “Converting circular structure to JSON” on Custom Postprocessing Effects
I’ve built a custom pixel distortion effect post-processing effect for R3F using @react-three/postprocessing’s . Here’s the gist:
CustomEffect file:
class CustomPixelDistortionEffect extends Effect {
...