Skip to main content
Filter by
Sorted by
Tagged with
11 votes
1 answer
6k views

I'm creating simple car game with cannon.js and I'm struggling with this. What I want to do: When I run with car into another object (e.g. sphere) I want to know about it. For example increase score ...
Martin's user avatar
  • 430
8 votes
0 answers
1k views

I want to simulate some blocks falling, but more like wooden blocks that don't have any elasticity or rubberiness to them. But I can't find settings that act like this. I've set restitution to 0 but ...
Jonathan Plackett's user avatar
7 votes
1 answer
5k views

Does anyone know how I can rotate a CannonJS (the physics library) CANNON.RigidBody? I'm trying to make the object rotate with the camera, so both are facing the same direction. I know I have to ...
Joey Morani's user avatar
  • 26.7k
6 votes
1 answer
7k views

This one is bugging me quite a bit. I'm trying to achieve rotation of a Cannon.Body based on the mouse input. By using the (Cannon) Three FPS example to demonstrate, you can see what the issue is. ...
Matt DeVenge's user avatar
6 votes
2 answers
7k views

I am creating a THREE.Mesh object using a THREE.JSONLoader object like so: // Create castle. loader.load('/Meshes/CastleTower.js', function(geometry, materials) { var tmp_material = new THREE....
rgajrawala's user avatar
  • 2,198
5 votes
1 answer
1k views

I am learning Three.js. I am trying to use Cannon-es to attach a cylinder body to a rose mesh I created in blender allowing it to fall into a vase. My issue is when I try to update the rose's position ...
Cody Luketic's user avatar
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
4 votes
2 answers
4k views

I need to know how can I generate a complex shape to integrate in my Three.js scene, with the benefit of Cannon.js physics. I started from this example: http://schteppe.github.io/cannon.js/demos/...
Rotan's user avatar
  • 597
4 votes
1 answer
3k views

I have two Cannon.js Objects, and have attached the "collide" event listener to both. carBody.addEventListener("collide",function(e){ }); I want to be able to react differently depending on how much ...
Jim Wiberley's user avatar
4 votes
1 answer
8k views

The short version: How can one make a camera follow an object controlled by physics within a Three.js scene? The long version: I'm working on a Three.js scene in which the W,A,S,D keys move a sphere ...
duhaime's user avatar
  • 27.9k
4 votes
1 answer
856 views

I have created a scene in A-Frame using 'A-Frame Physics System' (https://github.com/donmccurdy/aframe-physics-system) : <!DOCTYPE> <html> <head> <script src="aframe.min.js">&...
KK1993's user avatar
  • 43
4 votes
1 answer
2k views

I made a sphere in Babylon.js at the point [0,0,0], I want it to be like a planet with it's own gravity. Then I want a sphere (that will be the player) to be attracted to the center of the big sphere ...
Giovanne Afonso's user avatar
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
4 votes
1 answer
4k views

I'm interested in learning how to create dynamic objects and group them together entirely in react/JavaScript. I'm looking at the chair and table in this example as my model: https://codesandbox.io/s/...
NealWalters's user avatar
  • 18.5k
4 votes
1 answer
268 views

This has to do with Three.js + Socket IO + CANNON.js. I have an CANNON.RigidBody object on my SERVER, that i cannot send as it is. So i transform it like this: // Create a sphere var mass = 5, ...
Thor88's user avatar
  • 383
4 votes
0 answers
383 views

I have an issue with character movement in cannonjs and maybe some one can give me a hint. the issue: As you can see, there is a visual glitch when character moves. In cannonjs world I have a plane ...
Volodymyr Samoilenko's user avatar
3 votes
1 answer
6k views

i've looked in the cannon.js examples, and they seem to mostly use between -10 and -40 for gravity and something between 1 and 10 for the mass of an object (or CANNON.RigidBody as they are called), ...
joates's user avatar
  • 81
3 votes
1 answer
1k views

I'm using a simple setup Cannon.js, following the examples online, but when I set any property in the constructor, the position and angular velocity x, y and z are all NaN. This works, but does not ...
Jack Wild's user avatar
  • 2,142
3 votes
2 answers
3k views

I have seen many cloth simulations in three.js . I found it is done only with 2d plane surfaces . But is there a way that I can simulate a 3d cloth model like the one below .. There are many tutorials ...
RedBall's user avatar
  • 319
3 votes
1 answer
2k views

I m looking for a proper way to apply (or disable) gravity on individual objects (without loosing collide events or rotation velocity) I have read this issue but looking for a more complete answer. ...
TOPKAT's user avatar
  • 8,954
3 votes
1 answer
397 views

So I'm making a ball bounce in spark AR with cannon.js. Everything was working fine until I wanted to get the position of the forehead from the facetracker via the patch editor to a script. Error: ...
Martijn Gelton's user avatar
3 votes
1 answer
719 views

I am trying to make a rope-like constraint where the constraint is like a spring that bounces back. I'm trying to use the constraint component: <a-box id="other-box" dynamic-body /> <a-box ...
Piotr Adam Milewski's user avatar
2 votes
1 answer
2k views

I'm using Cannon.js with Three.js. I have set a scene which has 5 columns of 4 blocks stacked on top of each other. I want these to be interactable with other objects I'm planning on adding to the ...
danlong's user avatar
  • 900
2 votes
1 answer
1k views

I have a sphere and BoxGeometry in THREE.js. I've setted the standard gravity but my sphere (which is in the center of the box) keep falling down through the box here are my CANNON.js params Box const ...
JSmith's user avatar
  • 4,852
2 votes
1 answer
4k views

I'm trying to figure out how to create a minimal car with physics using Three.js and Cannon.js. I have created my visual and physics-based elements of my car and wheels, and my car responds to up ...
duhaime's user avatar
  • 27.9k
2 votes
2 answers
3k views

I am using a physics engine in my aframe application, and I want the camera to move when the user clicks a button. I want to keep the physics engine properties so I am using applyImpulse as a method ...
bear's user avatar
  • 663
2 votes
1 answer
2k views

I've searched everywhere and looked well issues and doc, but it seem that appart from creating a constraint between two Cannon bodies, there is no way to group shapes of different masses (for example)....
TOPKAT's user avatar
  • 8,954
2 votes
1 answer
3k views

I'm having a hard time wrapping my head around how to do this. What I'm trying to do, is move a physics body, by the means of velocity, toward another body, until it reaches and hits said body. (Think ...
Matt DeVenge's user avatar
2 votes
3 answers
3k views

So I'm using Three.js and I have some cubes inside of a box. I'm using the Transform Control to move the cubes around inside of the box with my mouse. I'd like to use raycasting in order to check ...
Dale's user avatar
  • 1,626
2 votes
2 answers
2k views

I have seen the CannonJS FPS Demo and noticed that it used a sphere for player collisions. My character is not in a form of a sphere, but rather a box or a capsule. I have tried using a box for ...
satvikb's user avatar
  • 319
2 votes
2 answers
2k views

I would like to achieve a space ship like move on a cannonJS body. (Im really a beginner) I found some examples but none of them are exactly what I'm looking for. As i know the correct way to move an ...
Tamás Katona's user avatar
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
2 votes
1 answer
2k views

I'm using Cannon.js to make a game where a ball bounces of of your head and the sides of the screen have boxes as boundaries. when the ball collides with the head it adds one more to the score. I want ...
Martijn Gelton's user avatar
2 votes
2 answers
907 views

I need to make a ball entering a tube with multiple tubes in my world. I created a tube by creating multiple box shapes that I then move and rotate to complete the tour of the tube. So far so good. I'...
raphaelameaume's user avatar
2 votes
1 answer
4k views

I'm working on something with three.js where i need a way to handle collisions between objects very generally. I was thinking of using cannon.js since it supports the primitives i need but i don't ...
Quazi's user avatar
  • 129
2 votes
1 answer
10k views

I'm just getting started with Three.js and cannon.js and I've been trying to create a simple room for a while with no success. I'm working off of this example and I've been trying to add walls and a ...
Penguinator'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
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
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
2 votes
0 answers
549 views

I'm working on a little three.js scene in which I want to drive a car down a road. The trouble is my car is flipping end to end each frame, instead of rolling on its tires: Does anyone know how I can ...
duhaime's user avatar
  • 27.9k
2 votes
0 answers
2k views

I've been using Cannon.js with Three.js a lot recently and they work great together. There's to be one part which I'm struggling to find information/examples about. Is it possible to rig a character ...
danlong's user avatar
  • 900
2 votes
0 answers
2k views

I have been trying to create in three.js a rope hanging from a point using any of the 3D physics libraries (ammo.js, cannon.js), but the only one I have successfully done is with (2D)verlet.js. I ...
RonMarcial's user avatar
2 votes
1 answer
2k views

I've been making a game in Babylon.js. In my game, there is a place where I have put a height map, it shows up when I run the scene, but when I try walking on it (or just standing on it) I fall ...
12YOK's user avatar
  • 72
1 vote
1 answer
2k views

Hey guys I am trying to make a simple 3js and cannon js demo, it is done except for the fact that it appears that there is a one unit off. https://www.dropbox.com/s/qqaal0hgq9a506e/Screenshot%202014-...
George Host's user avatar
1 vote
1 answer
900 views

I want to apply a drag force to a cannon.js' body, I've tried in a way but it's breaking the physics, wanted to know if there is a more correct way or if someone has already done something similar. ...
Pontiacks's user avatar
  • 1,158
1 vote
2 answers
776 views

Here is a fiddle with some of the code I'm working with. I'm rolling the dice, not randomly yet, but that'll be added later. But right now I'm having a hard time to find out which side the dice has ...
dethstrobe's user avatar
1 vote
1 answer
2k views

I have a THREE.js Scene where Objects have physcis applied to them using CANNON.js. The RigidBody is initialized like so: let shape = new CANNON.Box(new CANNON.Vec3(1, 1, 1)); let body = new CANNON....
Nicky's user avatar
  • 3,857
1 vote
1 answer
2k views

Noob Question: I'm trying to drop a ball to the floor and make it stick there or even roll over a plane. Right now it passes trough the plane. I'm not sure where I made a mistake or if I'm doing ...
pauloancheta'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