August 2018
Intermediate to advanced
528 pages
10h 58m
English
With ConeTwistConstraint, it is possible to create a constraint where the movement is limited to a set of angles. We can specify what the minimum and maximum angle is from one object to the other for the x, y, and z axes. We don't show this in an example, but using and creating this constraint works similar to the other ones discussed in this chapter. The easiest way to understand ConeTwistConstraint is by looking at the code required to create one. The code required to accomplish this is as follows:
var baseMesh = new THREE.SphereGeometry(1);
var armMesh = new THREE.BoxGeometry(2, 12, 3);
var objectOne = new Physijs.BoxMesh(baseMesh, Physijs.createMaterial(new THREE.MeshPhongMaterial({color: ...Read now
Unlock full access