physijs

Rotation When Object is Spinning

▼魔方 西西 提交于 2020-03-27 04:27:29
问题 [] [] Imagine those are the front tires of a car and they're spinning forward in a straight line. How would I rotate them (in a steering motion) without them being affected by their local (spinning) rotation? 回答1: Add a "wheel" to a THREE.Group() object and rotate the group on y-axis. for(var i = 0; i < wheels.length; i++){ steering[i].rotation.y = Math.sin(new Date() * 0.005) * 0.25; wheels[i].rotation.x += 0.1; } each steering is a THREE.Group(), each wheels is a cylinder. jsfiddle example

Physijs Load model three.js collisions don't work

£可爱£侵袭症+ 提交于 2019-12-08 00:57:48
问题 When I load my model(map) with JSONLoader I have a problem with collisions. If I load with BoxMesh it's work but the geometry collisions is like a cube, and my model is not a cube, the middle of my model is empty. And I put an other object (cube) on the top of my map the object stop on the top of this map not inside. After search, I have load my model with Convex, and the object ont the top , fall on the plane of my map but I think the size (40) is not load correctly because if I move the

Physijs Load model three.js collisions don't work

◇◆丶佛笑我妖孽 提交于 2019-12-06 13:32:55
When I load my model(map) with JSONLoader I have a problem with collisions. If I load with BoxMesh it's work but the geometry collisions is like a cube, and my model is not a cube, the middle of my model is empty. And I put an other object (cube) on the top of my map the object stop on the top of this map not inside. After search, I have load my model with Convex, and the object ont the top , fall on the plane of my map but I think the size (40) is not load correctly because if I move the object very little he fall in the space. I load my model like this: var loader = new THREE.JSONLoader();