mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
update example app
This commit is contained in:
parent
3705f97c61
commit
785e09d447
@ -12,13 +12,13 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue'
|
import { defineComponent } from 'vue'
|
||||||
import { Box, Camera, LambertMaterial, MeshInterface, PointLight, Renderer, RendererInterface, Scene } from './export'
|
import { Box, Camera, LambertMaterial, MeshPublicInterface, PointLight, Renderer, RendererPublicInterface, Scene } from './export'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { Box, Camera, LambertMaterial, PointLight, Renderer, Scene },
|
components: { Box, Camera, LambertMaterial, PointLight, Renderer, Scene },
|
||||||
mounted() {
|
mounted() {
|
||||||
const renderer = this.$refs.renderer as RendererInterface
|
const renderer = this.$refs.renderer as RendererPublicInterface
|
||||||
const mesh = (this.$refs.box as MeshInterface).mesh
|
const mesh = (this.$refs.box as MeshPublicInterface).mesh
|
||||||
if (renderer && mesh) {
|
if (renderer && mesh) {
|
||||||
renderer.onBeforeRender(() => {
|
renderer.onBeforeRender(() => {
|
||||||
mesh.rotation.x += 0.01
|
mesh.rotation.x += 0.01
|
||||||
|
Loading…
Reference in New Issue
Block a user