All Questions
Tagged with three.js typescript
296
questions
0
votes
0
answers
27
views
Three fiber properly initializing InstancedMesh with useEffect to prevent unnecessary updates
I am creating a three-fiber project of a globe with different markers in cities. The idea is that you can click on a marker to see information about the city.
To create the markers, I am using an ...
1
vote
0
answers
27
views
ThreeJs codepen to React component
I've been trying to move this codepen.io to a react component, this what I did:
React Custom Hook
import { useEffect, useRef } from 'react';
import * as THREE from 'three';
import { createNoise4D } ...
0
votes
1
answer
24
views
Cannot find module 'three/examples/jsm/controls/OrbitControls' or its corresponding type declarations
I'm using TypeScript and three.js in my React project, and I'm importing OrbitControls like so:
import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/...
2
votes
0
answers
58
views
Trouble with correctly triangulating a polygon on a sphere in THREE.js
tldr: help I can't correctly triangulate a GeoJSON polygon in 3D space to make it spherical and it has been haunting me for weeks. The question at the end of this novel is "Is this a poly2tri ...
0
votes
0
answers
19
views
issues with bcf coords while creating BCF
I’m using THREE JS perspective camera and I have bad time to get proper viewpoints, directions or upVectors, because my created bcf file with perspective camera coords do not work in other bcf readers....
3
votes
0
answers
63
views
Can I use a GPUBuffer which is the output of a compute shader as a Three.js or Babylon.js vertex position buffer?
I am experimenting whith webgpu. I found out that transferring data between cpu and gpu can be quite slow.
My goal is to simulate particle physics on the gpu using webgpu's compute shaders, then use ...
1
vote
0
answers
27
views
Fix skewed image when camera is rotated in three.js (R3F)
Here is a code snippet of what I have done so far
const Sphere = () => {
// url is an panoramic image of type .png, jpeg, webp, or jpg.
const texture = useLoader(THREE.TextureLoader, url);
...
0
votes
0
answers
23
views
CannonJS takes allot of force to start moving body
I'm making a movement system with cannonjs and threejs and I have reached a road block.
Basicly, when the player presses the W key it requires alot of force to start and keep moving.
To make the ...
0
votes
1
answer
39
views
Increase the dimensions of the loaded gltf model in Three js
I loaded a 3d model with gltf extension using GLTFLoader in Three.js.
const loader= new GLTFLoader();
//background box
loader.load('../../assets/backgroundBox.gltf',function(gltf){
...
0
votes
0
answers
18
views
@react-three/fiber create a sphere with diameter equals to the width of the canvas
I am new to the library and I would like to do something that i think is simple to have a sphere of diameter the same as the canvas.
I thought what I was doing was simple, but I was mistaken, I tried ...
0
votes
0
answers
41
views
Three.js Text Geometry not showing
I have been trying and googling but I can't find where the problem is with my code.
I have an Angular project in which I am using Three.js for some animations. Just basic simple 2D animations.
Based ...
1
vote
0
answers
94
views
React Three Fiber - Outline post processing issue
I have an issue with outline post processing. I would like to apply outline on planes when user moves the cursor over the planes. It is almost working but there is a small issue👇
When the mouse is ...
-1
votes
1
answer
39
views
Creating a new xr event
I am new to typescript and I am trying to implement the equivalent of a "double-click" event for a hand-input controller to interact with a mesh in my three-js app. I wish to do this the ...
0
votes
1
answer
40
views
Extracting Only the External Edges of Complex BufferGeometry in Three.js
I'm currently working on a project involving zone creation and collision detection using Three.js, where my application correctly handles collisions and generates a BufferGeometry as the outcome. My ...
0
votes
0
answers
24
views
NextJS with TS Three Error: "SyntaxError: Cannot use import statement outside a module"
I'm trying to add a sphere made with three in my NextJS project with TypeScript, I get my page to run when I navigate to the page where the sphere is, but if I reload the page I get the error
Error: &...