pages/site/.vitepress/theme/OrbitControls.vue

15 lines
364 B
Vue
Raw Normal View History

2024-06-20 11:27:48 +00:00
<template>
<TresOrbitControls
v-if="renderer"
:args="[camera, renderer?.domElement]"
/>
</template>
<script setup lang="ts">
import { extend, useTresContext } from '@tresjs/core';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
extend({ OrbitControls });
const { camera, renderer } = useTresContext();
</script>