Skip to content

Commit

Permalink
Merge pull request #11 from boomerdigital/editor-page
Browse files Browse the repository at this point in the history
Bring in THREE dependencies for editor page
  • Loading branch information
dhonig authored Sep 19, 2018
2 parents 9d38423 + 70cd3c8 commit bebc6b6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import './Box.css';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';

/* global THREE */
import * as THREE from "three";

// const OrbitControls = require('three-orbit-controls')(THREE);
// onst MTLLoader = require('three-mtl-loader');

// require('three-obj-loader')(THREE);
const OrbitControls = require('three-orbit-controls')(THREE);
const MTLLoader = require('three-mtl-loader');
const OBJLoader = require('three-obj-loader')(THREE);

let scene, camera, renderer, controls, cardCopyOutside,
canvasOutside, ctxOutside, cardCopyInside, canvasInside,
Expand Down Expand Up @@ -60,7 +59,7 @@ export default class Box extends PureComponent {
camera.position.set(5, 5, 8);
camera.translateY(1);

controls = new THREE.OrbitControls(camera, renderer.domElement);
const controls = new OrbitControls(camera, renderer.domElement);
controls.enableZoom = false;
controls.addEventListener('change', () => renderer.render(scene, camera));

Expand Down Expand Up @@ -119,7 +118,7 @@ export default class Box extends PureComponent {
const onProgress = () => {};
const onError = () => {};

const mtlLoader = new THREE.MTLLoader();
const mtlLoader = new MTLLoader();
const randomNumber = Math.random();
mtlLoader.load(`/images/assets/3d/box.mtl?rnd=${randomNumber}`, (materials) => {
materials.preload();
Expand Down
30 changes: 30 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@
"swiper": "^4.1.0",
"tether-drop": "^1.4.2",
"tether-tooltip": "^1.2.0",
"three": "^0.96.0",
"three-mtl-loader": "^1.0.2",
"three-obj-loader": "^1.1.3",
"three-orbit-controls": "^82.1.0",
"transliteration": "github:reactioncommerce/transliteration",
"url": "^0.11.0",
"validator": "^10.5.0",
Expand Down

0 comments on commit bebc6b6

Please sign in to comment.