1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

arcvhiz component =)

This commit is contained in:
Yang 2022-03-30 16:31:01 +08:00
parent 4de5e96380
commit 47dd16f5a9
6 changed files with 2457 additions and 2 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ dist
node_modules
temp
types
tester

View File

@ -1,5 +1,5 @@
{
"name": "troisjs",
"name": "troisjs-yang",
"version": "0.3.4",
"scripts": {
"dev": "vite",

View File

@ -0,0 +1,41 @@
import { defineComponent, h } from "vue";
import { PerspectiveCamera, Renderer, Scene } from "../../core";
import { PointLight } from "../../lights";
import { LambertMaterial } from "../../materials";
import { Box } from "../../meshes";
export default defineComponent({
name: "YangArchvizComponent",
components: {
PerspectiveCamera,
Renderer,
Scene,
PointLight,
LambertMaterial,
Box,
},
setup(props, { slots }){
return () =>h( Renderer, {
resize : "window" ,
}, () =>
[
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 )
])
])
]);
},
});

View File

@ -1,3 +1,5 @@
import YangArchvizComponent from './components/archviz/YangArchvizComponent'
export * from './core/index'
export * from './geometries/index'
export * from './lights/index'
@ -5,6 +7,7 @@ export * from './materials/index'
export * from './meshes/index'
export * from './models/index'
export * from './effects/index'
export { default as YangArchvizComponent} from './components/archviz/YangArchvizComponent'
// export * from './components/index'

View File

@ -77,10 +77,12 @@ export const TroisJSVuePlugin = {
'TiltShiftPass',
'UnrealBloomPass',
'ZoomBlurPass',
'YangArchvizComponent',
]
comps.forEach(comp => {
// @ts-ignore
// @ts-ignore
app.component(comp, TROIS[comp])
})
},

2408
yarn.lock Normal file

File diff suppressed because it is too large Load Diff