diff --git a/src/components/archviz/YangArchvizComponent.ts b/src/components/archviz/YangArchvizComponent.ts index 5cb0966..c697777 100644 --- a/src/components/archviz/YangArchvizComponent.ts +++ b/src/components/archviz/YangArchvizComponent.ts @@ -1,40 +1,33 @@ import { defineComponent, h } from "vue"; import { PerspectiveCamera, Renderer, Scene } from "../../core"; -import { PointLight } from "../../lights"; -import { LambertMaterial } from "../../materials"; -import { Box } from "../../meshes"; +import { AmbientLight } from "../../lights"; +import { GltfModel } from "../../models"; export default defineComponent({ name: "YangArchvizComponent", - components: { - PerspectiveCamera, - Renderer, - Scene, - PointLight, - LambertMaterial, - Box, + props: { + gltfUrl : String }, - setup(props, { slots }){ + components: { }, + setup(props, { slots, expose }){ + const url : String = props.gltfUrl ?? ""; + + const gltfProps = { + src : url + } + + //@ts-ignore + const gltfVNode = h( GltfModel, gltfProps ); return () =>h( Renderer, { resize : "window" , + alpha : true }, () => - [ - h( PerspectiveCamera, { - position: { z: 10 } - }), + [ h( Scene , {}, () => - [ - h( PointLight, { - position: { y: 50, z: 50 } - }), - h( Box, { - size : 1, - rotation : { y: Math.PI / 4, z: Math.PI / 4 }, - }, () => - [ - h( LambertMaterial ) - ]) + [ + h( AmbientLight ), + gltfVNode ]) ]); },