-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc6babf
commit 1248c1d
Showing
7 changed files
with
66 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script setup lang="ts"> | ||
import { inject } from 'vue' | ||
import type { Camera, Scene } from 'three' | ||
import { BoxGeometry, Mesh, MeshBasicMaterial } from 'three' | ||
import { defineWidget } from '@vue-motion/core' | ||
import type { Object3DOptions } from './object3d' | ||
export interface CubeOptions extends Object3DOptions { | ||
width: number | ||
height: number | ||
depth: number | ||
} | ||
const props = defineProps<CubeOptions>() | ||
const options = defineWidget<CubeOptions>(props) | ||
const camera = inject('camera') as Camera | ||
const scene = inject('scene') as Scene | ||
const box = new BoxGeometry(options.width, options.height, options.depth) | ||
const material = new MeshBasicMaterial() | ||
const cube = new Mesh(box, material) | ||
scene.add(cube) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
export type { Widget3DOptions } from './widget3d.vue' | ||
export { default as Widget3D } from './widget3d.vue' | ||
export type { Widget3DOptions } from './widget3d' | ||
export type { Object3DOptions } from './object3d' | ||
|
||
export type { ThreeOptions } from './three.vue' | ||
export { default as Three } from './three.vue' | ||
export type { CubeOptions } from './cube.vue' | ||
export { default as Cube } from './cube.vue' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { Widget3DOptions } from './widget3d.ts' | ||
|
||
export interface Object3DOptions extends Widget3DOptions { | ||
fillColor?: string | ||
borderColor?: string | ||
borderWidth?: number | ||
borderOffset?: number | ||
borderInterval?: number[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { WidgetOptions } from "@vue-motion/lib" | ||
|
||
export interface Widget3DOptions extends WidgetOptions { | ||
x?: number | ||
y?: number | ||
z?: number | ||
rx?: number | ||
ry?: number | ||
rz?: number | ||
scaleX?: number | ||
scaleY?: number | ||
scaleZ?: number | ||
opacity?: number | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters