Skip to content

Commit

Permalink
fix(ghostCanvas): use map controls to fix tracking camera (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
wopian authored Jun 25, 2023
1 parent 097692d commit 3673d88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/canvases/GhostCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
const { center } = createSphere(scene, allPoints)
const cameraOffsets = {
x: 1.1,
x: 1.5,
y: 1.5,
z: 1.5
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/three/createGhostScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Vector3,
WebGLRenderer
} from 'three'
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'
import { MapControls } from 'three/examples/jsm/controls/MapControls.js'

export const createGhostScene = () => {
const renderer = new WebGLRenderer({ alpha: true, antialias: true })
Expand All @@ -27,7 +27,7 @@ export const createGhostScene = () => {
)
scene.add(camera)

const controls = new OrbitControls(camera, renderer.domElement)
const controls = new MapControls(camera, renderer.domElement)
controls.enableDamping = true
controls.dampingFactor = 0.05
controls.screenSpacePanning = true
Expand Down

0 comments on commit 3673d88

Please sign in to comment.