Created
October 1, 2015 11:14
-
-
Save nickjanssen/8f7cb1dac5f8a7cd8488 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mesh.traverseAncestors(function (parent) { | |
parent.updateMatrixWorld(true); | |
}) | |
var worldScale = mesh.getWorldScale(); | |
var worldRotation = mesh.getWorldQuaternion(); | |
var boxWidth: json.userData.size[0] * worldScale.x; | |
var boxHeight: json.userData.size[1] * worldScale.y; | |
var boxDepth: json.userData.size[2] * worldScale.z; | |
var offset: (new THREE.Vector3()).fromArray(json.userData.center) | |
.multiply(worldScale) | |
.applyQuaternion(worldRotation); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment