mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 12:22:03 +08:00
arcvhiz component =)
This commit is contained in:
parent
4de5e96380
commit
47dd16f5a9
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ dist
|
|||||||
node_modules
|
node_modules
|
||||||
temp
|
temp
|
||||||
types
|
types
|
||||||
|
tester
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "troisjs",
|
"name": "troisjs-yang",
|
||||||
"version": "0.3.4",
|
"version": "0.3.4",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
41
src/components/archviz/YangArchvizComponent.ts
Normal file
41
src/components/archviz/YangArchvizComponent.ts
Normal 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 )
|
||||||
|
])
|
||||||
|
])
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
});
|
@ -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'
|
||||||
|
|
||||||
|
@ -77,6 +77,8 @@ export const TroisJSVuePlugin = {
|
|||||||
'TiltShiftPass',
|
'TiltShiftPass',
|
||||||
'UnrealBloomPass',
|
'UnrealBloomPass',
|
||||||
'ZoomBlurPass',
|
'ZoomBlurPass',
|
||||||
|
|
||||||
|
'YangArchvizComponent',
|
||||||
]
|
]
|
||||||
|
|
||||||
comps.forEach(comp => {
|
comps.forEach(comp => {
|
||||||
|
Loading…
Reference in New Issue
Block a user