1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 12:22:03 +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 node_modules
temp temp
types types
tester

View File

@ -1,5 +1,5 @@
{ {
"name": "troisjs", "name": "troisjs-yang",
"version": "0.3.4", "version": "0.3.4",
"scripts": { "scripts": {
"dev": "vite", "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 './core/index'
export * from './geometries/index' export * from './geometries/index'
export * from './lights/index' export * from './lights/index'
@ -5,6 +7,7 @@ export * from './materials/index'
export * from './meshes/index' export * from './meshes/index'
export * from './models/index' export * from './models/index'
export * from './effects/index' export * from './effects/index'
export { default as YangArchvizComponent} from './components/archviz/YangArchvizComponent'
// export * from './components/index' // export * from './components/index'

View File

@ -77,6 +77,8 @@ export const TroisJSVuePlugin = {
'TiltShiftPass', 'TiltShiftPass',
'UnrealBloomPass', 'UnrealBloomPass',
'ZoomBlurPass', 'ZoomBlurPass',
'YangArchvizComponent',
] ]
comps.forEach(comp => { comps.forEach(comp => {

2408
yarn.lock Normal file

File diff suppressed because it is too large Load Diff