feat(nds): fixed camera position
This commit is contained in:
@@ -142,6 +142,11 @@ onRender(({ delta }) => {
|
|||||||
const handleClick = (event: MouseEvent) => {
|
const handleClick = (event: MouseEvent) => {
|
||||||
if (!scene.value) return;
|
if (!scene.value) return;
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
camera.activeCamera.value?.getWorldPosition(new THREE.Vector3()),
|
||||||
|
camera.activeCamera.value?.rotation,
|
||||||
|
);
|
||||||
|
|
||||||
const domElement = renderer.instance.domElement;
|
const domElement = renderer.instance.domElement;
|
||||||
const rect = domElement.getBoundingClientRect();
|
const rect = domElement.getBoundingClientRect();
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,11 @@ const bottomScreenCanvas = computed(() => bottomScreen.value?.canvas ?? null);
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<TresCanvas window-size clear-color="#181818">
|
<TresCanvas window-size clear-color="#181818">
|
||||||
<TresPerspectiveCamera :args="[45, 1, 0.001, 1000]" />
|
<TresPerspectiveCamera
|
||||||
<OrbitControls />
|
:args="[45, 1, 0.001, 1000]"
|
||||||
|
:position="[0, 10, 12]"
|
||||||
|
:rotation="[-Math.PI / 4.7, 0, 0]"
|
||||||
|
/>
|
||||||
|
|
||||||
<TresAmbientLight />
|
<TresAmbientLight />
|
||||||
<TresDirectionalLight />
|
<TresDirectionalLight />
|
||||||
|
|||||||
Reference in New Issue
Block a user