Reputation: 21
I am currently working on a project with three.js (voxel painter). I encounter a problem when I change the size of a cube the xyz axis remains centered on the cube and does not place at the extreme left of the cube, which gets a shift of the cube when it is placed on the grid
cubegeo= new THREE.BoxGeometry(100, 50, 70)
What I want
By default on three.js
Upvotes: 0
Views: 1062
Reputation: 11
You can apply matrix to the cubegeo:
cubegeo.applyMatrix( new THREE.Matrix4().makeTranslation(cubeWidth/2, cubeHeight/2, cubeLength/2) );
Upvotes: 1