Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
100 views

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 ...
Rickson Guidolini's user avatar
0 votes
1 answer
62 views

its been a while since I worked on this project but I have just come back to it and turns out its broken. I did some testing and I was able to pin point the problem but I have no clue how to fix it. ...
Blaze Branham's user avatar
1 vote
0 answers
67 views

I am trying to create an app which simulates celestial bodies in space. I am using three.js for rendering and cannon.js for physics simulation. Here with this code I am not able to get a stable orbit ...
Pathan Valimkhan's user avatar
1 vote
0 answers
18 views

I am trying to load a .glb file created in blender to a three.js with cannon-es for physics/gravity. My goal is to be able to extend and retract each individual actuator added to my model. The model ...
Matthew Flynn's user avatar
1 vote
1 answer
107 views

I am trying to make those little interractive balls that are on some websites, but when i try to increase the ball size not only do they not get bigger but the gravity falls apart, and i am just so ...
frenchDude12399's user avatar
0 votes
1 answer
69 views

I have a sword model in the camera using camera.add(sword), but how would I get cannon.js body to copy that sword position and quaternion? I tried adding the cannon.js body to another that is acting ...
Blaze Branham's user avatar
0 votes
1 answer
35 views

I'm learning three js recently and I'm trying to mimic the scene which is present in below link by downloading the model https://sketchfab.com/3d-models/ccity-building-set-1-...
Pramod Kumar's user avatar
  • 1,191
4 votes
1 answer
1k views

My glb file wont show up inside my thee.js world. I have followed all the documentations and tutorals but nothing works. the world loads and evry thing works fine its just that the moddle dose not ...
Blaze Branham's user avatar
0 votes
0 answers
44 views

I use glmatrix 3.4.0 . Any suggestion ! mat4.identity(object.mvMatrix); this.mvPushMatrix(object.mvMatrix, this.mvMatrixStack); mat4.translate(object.mvMatrix, object.mvMatrix, object.position....
Nikola Lukic's user avatar
  • 4,274
1 vote
0 answers
213 views

I use glmatrix 3.4.0 . With position i dont have any problem. Event glmatrix last version have some support for QUAT i cant make correct way of converting from QUAT to AxisAngle or rotate mat4 ... I ...
Nikola Lukic's user avatar
  • 4,274
1 vote
1 answer
98 views

I'm trying to create a tetrahedron in Three.js along with a corresponding Cannon.js body using ConvexPolyhedron. However, I find myself having to guess the vertices and faces for the shape, like this. ...
Samarth's user avatar
  • 63
0 votes
1 answer
344 views

I have a THREE.js plane that the points are moved up and down using Perlin noise to make terrain. Now I need to add physics to the camera to stop it from just falling through the plane. I'm hoping to ...
Owen Odroski's user avatar
0 votes
1 answer
97 views

so i have a player controller for an fps game that applies force based on keyboard inputs to a dynamic cannon body. angularDampining=1 on the player body. the playercontroller class takes both in the ...
CODERjack's user avatar
0 votes
1 answer
201 views

i have tryed somany ways but i cant get cannon.js to work in my code. when ever i try to make a world it just goes blank, please help. I cannot find any links or ways to get it to work. I am a new ...
Blaze Branham's user avatar
1 vote
1 answer
91 views

I have two cannonjs boxes. Box1 serve as character that moves with arrow keys.Box 2 serve as house . When i move Box1 towards Box2 , Box1 gets sliding to very large distance continuously. I want that ...
Gaurav Sharma's user avatar
1 vote
0 answers
75 views

I've been trying to make a good movement script for a few months now but the one I have now isn't very good. (I'm still a beginner). This is my code: import * as THREE from 'three' import { ...
Insert Name Here's user avatar
0 votes
1 answer
221 views

I am trying to make a simple 3D object with Three.JS and CANNON.js, but cannot seem to make the collider shape match the visual object's shape. I am creating my shape const geometry = new THREE....
yoav trachtman cohen's user avatar
0 votes
1 answer
150 views

When I use useRef for access a mesh, I can change its position as this: const [boxRef] = useRef(); ... boxRef.current.position.setX(boxRef.current.position.x + 1); And it works! But when I use useBox ...
Ali Bahaari's user avatar
1 vote
0 answers
244 views

I'm trying to create a cloth simulation using @react-three/fiber and @react-three/cannon. I created particles that respond to physics. However, I would like to reproduce this behavior on cloth. ...
Bart Krakowski's user avatar
1 vote
0 answers
162 views

I'm trying to use CANNON.js with three.js. All is working well with cube, sphere, and plane, but now when I try with Cylinder, it is rotating weirdly. I do NOT want to rotate the three.js object to ...
TheHaloDeveloper's user avatar
2 votes
0 answers
1k views

So I have a react-three/fiber scene component, where I am animating a rigged character. I want to apply colliders to eg. the hands, so that the movement and rotation of the skinned mesh will apply to ...
konrad's user avatar
  • 99
2 votes
1 answer
1k views

I found this great example of creating 3D dice with react-three-fiber at https://codesandbox.io/s/reverent-lalande-5qdk4j. I want to do something similar but with deterministic rolling, meaning I can ...
Kairei's user avatar
  • 131
1 vote
0 answers
114 views

Question: I have a 3D rotation specified by three coordinates. How do I transform this into a CannonJS quaternion to physically rotate the body? // I saw this online: var qX = new CANNON.Quaternion() ...
Jason Roman's user avatar
0 votes
1 answer
227 views

Currently in my game, I have a character with spheres as its collision box with 0 friction. When moving into walls everything works smoothly as intended (I'm setting the character body's velocity) ...
Kilroy's user avatar
  • 33
2 votes
0 answers
160 views

I can create gravity in the whole world but I want to create a gravitational attraction between objects so I can simulate planets and stuff. I tried making a function for Newton's law of universal ...
Majesto's user avatar
  • 21
0 votes
1 answer
1k views

I recently started working with physics engines. I am using cannon-es.js with three.js. The box and the loaded model are just passing through the plane and falling out of view. I tried using ...
Q123's user avatar
  • 1
0 votes
0 answers
289 views

I'm working on a uni project with 3D JS, using Three.js, Cannon.js, and DragControls. I'm having some trouble with the behavior of my spheres. Whenever they get pushed into each other and let go, they ...
florizer's user avatar
1 vote
0 answers
99 views

I want to create a vehicle, that moves around in three.js and cannon.js. But when I update the position of the three.js model it moves so little also backwards I have no Idea what is causing the ...
Adrian 's user avatar
0 votes
1 answer
351 views

I want to do the cannon-es body of a THREE.js Torus, and I am not finding the right shape. Sadly there's no built-in CANNON.Torus class. For reference, This is how a THREE.js Torus looks like: Any ...
Danilo Bassi's user avatar
1 vote
2 answers
480 views

I am trying to implement a dice roller in three js and cannon-es. It works perfectly fine if I have only one dice. It rolls against the ground plane in a reasonable way. When I add another dice it ...
munHunger's user avatar
  • 3,115
1 vote
0 answers
107 views

I am trying to make a spider have a certain velocity when control keys are pressed using react three cannon. The 3D model rolls along with the sphere. The code is as follows: // import { useFBX } from ...
Saptarshi's user avatar
  • 669
1 vote
0 answers
85 views

Most important code just for example. Func UPDATE is called in every draw frame. I want implement jumping virtualJumpActive == true logic. I invert procedure for virtualJumpActive == true to make ...
Nikola Lukic's user avatar
  • 4,274
1 vote
0 answers
292 views

I cannot combine the horizontal movement of the wheels with the vertical movement. Additionally, the wheels only move forward. I have no idea how to check if the vehicle is moving forward or backward ...
Filip Kwiatkowski's user avatar
0 votes
2 answers
1k views

I want to position a box within a floor and 4 walls so the boxes movements would be within a constraint. This example shows a floor and backwall and works fine. However. I want to add left/right and ...
wanna_coder101's user avatar
1 vote
0 answers
1k views

I've found this question asked before but the solutions offered did not solve my issue. I've tried creating this project in only @react-three but I've added vanilla three and cannon to supplement my @...
paq's user avatar
  • 117
2 votes
0 answers
1k views

I'm getting the error "Uncaught TypeError: Cannot read property 'yMax' of undefined" when adding text to a three.js scene using React-three/fiber. I've successfully rendered other geometries ...
paq's user avatar
  • 117
5 votes
0 answers
615 views

I am having issues trying to make collision work properly with an imported glb file only used for collision. There are two parts to this question: I am currently getting a whole lot of faceNormal ...
szr1ght's user avatar
  • 51
0 votes
1 answer
130 views

Very new to coding and Im following a course on three.js using cannon-es, I have quickly come to understand the need to keep things organized in classes using constructor, (my project is currently all ...
Skelloid's user avatar
1 vote
0 answers
488 views

I am creating a first person game. The room model has only walls and floors. The model is npx gltfjsx . /public/box2.glb and converted to React code. It is then loaded using GLTFLoader. The model I ...
keno's user avatar
  • 13
1 vote
0 answers
35 views

I'm currently making a simple fps movement based game in three.js using cannon.js physics. But I've run into a problem with my first person controls function onMouseMove( event ) { if ( scope....
csaseymour's user avatar
1 vote
1 answer
1k views

I wanted to ask. I have this goal to create a Pointer Lock Control but also apply physics to the control, so when the camera hit a wall it doesn't move to that direction (Where collision occur). My ...
Matthew's user avatar
  • 11
2 votes
2 answers
896 views

i'm trying react-three/cannon and my goal is to drop a "Cube" and a "GLTF model" from a position and let them land on a "Floor". it works well for the Cube (he touches ...
Adev's user avatar
  • 21
0 votes
1 answer
1k views

Basically I've created a group of 2 meshes in Three.js and a Body containing 2 Shapes in Cannon. Separately they appear fine but when I copy the Body position to the meshes to add physics the code ...
SlugLord's user avatar
  • 175
1 vote
1 answer
446 views

Here is the demo but it always says that I am missing the modules whereas I have all the dependancies : https://tympanus.net/codrops/2020/02/11/how-to-create-a-physics-based-3d-cloth-with-cannon-js-...
ambaamba's user avatar
  • 131
0 votes
1 answer
1k views

I've started my journey of making an interactive gallery using react-three. I already have the First-Person mechanics figured out and I made a small room to walk and interact. I want to escalate the ...
Mickael Neves's user avatar
0 votes
1 answer
2k views

I'm trying to set dynamic camera position behind the car implemented in a project similar to CAR using raycastVehicle I tried to change camera's position using state/hooks, but I am unable locate car'...
ChirAdi's user avatar
  • 43
-1 votes
1 answer
487 views

i am learning cannon.js and i am have this error Uncaught TypeError: CANNON.NaiveBroadPhase is not a constructor i tried so many things but nothing is working. and here is my script: var scene, camera,...
Unknown's user avatar
  • 21
1 vote
1 answer
2k views

I'm having some difficulty getting my camera to follow an object. The object is using a hook useSphere from @react-three/cannon. My sphere moves around fine, but the camera does not follow. Ive ...
Code-Cody-418's user avatar
1 vote
1 answer
838 views

Please I want to know if there is anything like origin point in three.js just as we have it in Blender, please I have tried to do a research on this topic but to no avail. I want to make a pinball ...
user avatar
0 votes
1 answer
376 views

I'm working with cannon-es (a maintained fork of cannon.js). I need to fix an object in space for a certain period of time. So, I do body.sleep() in these cases. The problem is that object can ...
aitor's user avatar
  • 2,755