Created
September 27, 2017 09:11
-
-
Save mattearnshaw/671dc1f93ec82f8626649bcf28147f2b to your computer and use it in GitHub Desktop.
This file contains 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
// in src/main/webapp/js/components/interface/3dCanvas/ThreeDEngine.js | |
create3DCylinderFromNode: function (cylNode, material, radiusMultiplier) { | |
+ | |
+ if (radiusMultiplier === undefined) radiusMultiplier = 1 | |
var bottomBasePos = new THREE.Vector3(cylNode.position.x, cylNode.position.y, cylNode.position.z); | |
var topBasePos = new THREE.Vector3(cylNode.distal.x, cylNode.distal.y, cylNode.distal.z); | |
@@ -978,6 +982,7 @@ define(['jquery'], function () { | |
var midPoint = new THREE.Vector3(); | |
midPoint.addVectors(bottomBasePos, topBasePos).multiplyScalar(0.5); | |
+ var c = new THREE.CylinderGeometry(cylNode.topRadius * radiusMultiplier, cylNode.bottomRadius * radiusMultiplier, axis.length(), 20, 1, false); | |
var c = new THREE.CylinderGeometry(cylNode.topRadius, cylNode.bottomRadius, axis.length(), 20, 1, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment