All Questions
Tagged with three.js javascript
10,939
questions
1
vote
1
answer
18
views
Error importing troika-three-text with importmap
I'm trying to get the troika-three-text into my Three.js script by importing it via the html, as shown below:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=&...
0
votes
0
answers
29
views
Why my 3d model keeps placing text not in the middle of y coordinates but a little below it?
I’ve spent two days going back and forth, and it’s still the same. The text engraving depth varies on my curved 3D ring model—one side of the letter is deep, while the other side is not. I’m trying to ...
0
votes
1
answer
28
views
OrbitControls in ThreeJS not working with import map
I'm trying to get a simple ThreeJs with OrbitControls for pan and zoom. I was able to get a working example with an older version (128), but I'm having trouble with the newer r168.
In the example, I'm ...
0
votes
0
answers
29
views
How do I make a mesh with an EdgesGeometry always on top but still make the outline behind the mesh hidden?
How to make the box on the right? I used depthTest false on the box and its outline to make it always on top of other mesh but the outline is now ignoring the box depth.
Here is the sample code the ...
0
votes
0
answers
14
views
3D object not showing in the 3D space - jsartoolkit5
this is my first question, so I hope to do everything as intended.
I'm currently trying to learn a little bit about augmented reality using web apps and I'm trying to do some basic stuff.
I'm trying ...
0
votes
0
answers
27
views
texture bug when use ShaderMaterial in three.js
import React, { useRef, useEffect } from 'react';
import { Canvas, useFrame, useThree } from '@react-three/fiber';
import { OrbitControls } from '@react-three/drei';
import { useLoader } from '@react-...
0
votes
0
answers
27
views
Adjusting PlaneGeometry Dimensions and Camera Distance to Fill Screen width or height Without Exceeding Boundaries
I am trying calculate the camera distance so that it fills the entire screen width or height without exceeding the screen boundaries.
Requirements
Get the width and height of renderer.domElement.
...
0
votes
0
answers
17
views
Three.js efficient way to build a block terrain
what I'm trying to achieve is not easy to explain.
But what I'm trying to do is build a "boxy" terrain that represents an elevation grid.
The issue that I'm now facing is that three.js is ...
0
votes
2
answers
83
views
Threejs Phone vertical sticky carousel react-three/fiber
I have stacked the sticky areas - but how to add the text in the same style/manner. Also I've created refs for each of the phone scenes - but its no longer sticking - and I am unsure what causes it to ...
0
votes
0
answers
43
views
How to draw on old 3d json object, then take the 2d svg's of these drawings?
I have created a kit designer which is a 3d json with this metadata:
"metadata":{
"faces":5104,
"vertices":5198,
"uvs":1,
"version":3,
...
0
votes
0
answers
36
views
I can't move my GLTF model from AR mode from the camera with threejs and webxr
I'm new to using webxr with threejs and I'm doing AR experiences. I've been trying for 2 days to do a functionality that is within the examples on the threejs page https://threejs.org/examples/?q=...
0
votes
1
answer
50
views
Meshes overlapping with sin() and cos() animation
I'm new to JavaScript and Three.js, nice to meet all of you !
This code is for creating 4 cubes and one arrow. Like this image:
Image1
// Scene
const scene = new THREE.Scene();
// Groups
const cubes =...
1
vote
1
answer
44
views
How to make a collision that works with rotation?
I have a problem because - if I rotate the block collision is still a box. I want to make hit boxes rotated too but I don't know what to do.
Also I don't use import in libraries.
Here is my code to ...
0
votes
0
answers
31
views
How to speed up Three.js file when using document.getElementById
I just started using Three.js and created a program which made a globe. When I run this just in the window without using document.getElementById it runs very fast. However, use it in an abridged code ...
0
votes
1
answer
37
views
built dose not shoot straight in three.js
I'm trying to make a shooter in three.js, my bullet shoots right where I turn left and right but when I look up and down it moves up and down but it does not rotate with it.
for (let index=0;index&...