don't convert geometry

This commit is contained in:
casperlamboo 2017-11-12 13:50:49 +01:00
parent c65a5a3df4
commit 9c233b1ab6

View File

@ -10,12 +10,8 @@ export function placeOnGround(mesh) {
} }
export function createScene(canvas, props, state) { export function createScene(canvas, props, state) {
let geometry; const { width, height, printers, geometry } = props;
if (props.geometry.isGeometry) { const { controlMode, printer } = state;
geometry = props.geometry;
} else if (props.geometry.isBufferGeometry) {
geometry = new THREE.Geometry().fromBufferGeometry(props.geometry);
}
// center geometry // center geometry
geometry.computeBoundingBox(); geometry.computeBoundingBox();
@ -24,9 +20,6 @@ export function createScene(canvas, props, state) {
const centerZ = (geometry.boundingBox.max.z + geometry.boundingBox.min.z) / 2; const centerZ = (geometry.boundingBox.max.z + geometry.boundingBox.min.z) / 2;
geometry.applyMatrix(new THREE.Matrix4().makeTranslation(-centerX, -centerY, -centerZ)); geometry.applyMatrix(new THREE.Matrix4().makeTranslation(-centerX, -centerY, -centerZ));
const { width, height, printers } = props;
const { controlMode, printer } = state;
const renderer = new THREE.WebGLRenderer({ canvas, alpha: true }); const renderer = new THREE.WebGLRenderer({ canvas, alpha: true });
renderer.setClearColor(0xffffff, 0); renderer.setClearColor(0xffffff, 0);
renderer.setSize(width, height); renderer.setSize(width, height);