Skip to content

Commit

Permalink
Revert "Sorta fixed lights and sorta fixed slowed down camera on 3d r…
Browse files Browse the repository at this point in the history
…over"

This reverts commit 62b932f.
  • Loading branch information
amwgvf committed May 19, 2021
1 parent 62b932f commit aca374c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
10 changes: 1 addition & 9 deletions Electron/src/Core/components/Paint.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import THREE from "./Three"
const OrbitControls = require("three-orbit-controls")(THREE)

const DIRECTIONAL_LIGHT = "directionalLight"
const PERSPECTIVE_CAMERA = "PerspectiveCamera"

class Paint {
constructor() {
Expand Down Expand Up @@ -46,10 +45,6 @@ class Paint {
if (directionalLightObj) {
this.scene.remove(directionalLightObj)
}
const PerspectiveCameraObj = this.scene.getObjectByName(PERSPECTIVE_CAMERA)
if (PerspectiveCameraObj) {
this.scene.remove(PerspectiveCameraObj)
}

if (this.animationRequestId) {
cancelAnimationFrame(this.animationRequestId)
Expand Down Expand Up @@ -227,13 +222,10 @@ class Paint {
delete this.mesh
}
const directionalLightObj = this.scene.getObjectByName(DIRECTIONAL_LIGHT)
const PerspectiveCameraObj = this.scene.getObjectByName(PERSPECTIVE_CAMERA)
if (directionalLightObj) {
this.scene.remove(directionalLightObj)
}
if (PerspectiveCameraObj) {
this.scene.remove(PerspectiveCameraObj)
}

if (this.animationRequestId) {
cancelAnimationFrame(this.animationRequestId)
}
Expand Down
7 changes: 5 additions & 2 deletions Electron/src/Core/components/STLViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ class STLViewer extends Component<IProps, IState> {
cameraX: 0,
cameraY: 0,
cameraZ: null,
lights: [[0, 5, 1]],
lightColor: "#ffffff",
lights: [
[0, 5, 1],
[0, -5, 1],
],
lightColor: "#B92C2C",
rotation: [0, 0, 0],
rotationSpeeds: [0, 0, 0.02],
model: undefined,
Expand Down

0 comments on commit aca374c

Please sign in to comment.