-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from sunquakes/development
Add fbx and obj loader.
- Loading branch information
Showing
34 changed files
with
159,588 additions
and
256 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
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,24 @@ | ||
<template> | ||
<tv-scene class="scene" v-model="sceneValue" @created="created"> | ||
<tv-fbx-loader v-model="fbxUrl" :scene="sceneValue"></tv-fbx-loader> | ||
</tv-scene> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from 'vue' | ||
const fbxUrl = ref('/models/girl.fbx') | ||
const sceneValue = ref(null) | ||
const created = (scene, { camera }) => { | ||
camera.position.set(0, 1.5, 3) | ||
} | ||
</script> | ||
|
||
<style> | ||
.scene { | ||
margin-top: 10px; | ||
width: 100%; | ||
height: 300px; | ||
} | ||
</style> |
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 @@ | ||
<template> | ||
<tv-scene class="scene" @created="created"></tv-scene> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { FBXLoader } from 'three-vue3' | ||
const created = async (scene, { camera }) => { | ||
camera.position.set(0, 1.5, 3) | ||
// Load model to scene. | ||
const model = await FBXLoader('/models/girl.fbx') | ||
scene.add(model) | ||
} | ||
</script> | ||
|
||
<style> | ||
.scene { | ||
margin-top: 10px; | ||
width: 100%; | ||
height: 300px; | ||
} | ||
</style> |
File renamed without changes.
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 @@ | ||
<template> | ||
<tv-scene class="scene" @created="created"></tv-scene> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { GLTFLoader } from 'three-vue3' | ||
const created = async (scene, { camera }) => { | ||
camera.position.set(0, 1.5, 3) | ||
// Load model to scene. | ||
const model = await GLTFLoader('/models/girl.glb') | ||
scene.add(model) | ||
} | ||
</script> | ||
|
||
<style> | ||
.scene { | ||
margin-top: 10px; | ||
width: 100%; | ||
height: 300px; | ||
} | ||
</style> |
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,29 @@ | ||
<template> | ||
<tv-scene class="scene" @created="created"></tv-scene> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ME, GLTFLoader } from 'three-vue3' | ||
const created = async (scene, { camera }) => { | ||
camera.position.set(0, 1.5, 3) | ||
// Load model to scene. | ||
const model = await GLTFLoader('/models/girl.glb', true) | ||
scene.add(model) | ||
// Create movable element. | ||
const element = new ME(model, [0, 0, -1]) | ||
// Move to [0, 0, 0] from [0, 0, -1] in 10 seconds. | ||
element.moveTo([0, 0, 0], 10000) | ||
} | ||
</script> | ||
|
||
<style> | ||
.scene { | ||
margin-top: 10px; | ||
width: 100%; | ||
height: 300px; | ||
} | ||
</style> |
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,25 @@ | ||
<template> | ||
<tv-scene class="scene" v-model="sceneValue" @created="created"> | ||
<tv-obj-loader v-model="objUrl" :mtl="mtlUrl" :scene="sceneValue"></tv-obj-loader> | ||
</tv-scene> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from 'vue' | ||
const objUrl = ref('/models/obj/girl.obj') | ||
const mtlUrl = ref('/models/obj/girl.mtl') | ||
const sceneValue = ref(null) | ||
const created = (scene, { camera }) => { | ||
camera.position.set(0, 1.5, 3) | ||
} | ||
</script> | ||
|
||
<style> | ||
.scene { | ||
margin-top: 10px; | ||
width: 100%; | ||
height: 300px; | ||
} | ||
</style> |
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 @@ | ||
<template> | ||
<tv-scene class="scene" @created="created"></tv-scene> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { OBJLoader } from 'three-vue3' | ||
const created = async (scene, { camera }) => { | ||
camera.position.set(0, 1.5, 3) | ||
// Load model to scene. | ||
const model = await OBJLoader('/models/obj/girl.obj', '/models/obj/girl.mtl') | ||
scene.add(model) | ||
} | ||
</script> | ||
|
||
<style> | ||
.scene { | ||
margin-top: 10px; | ||
width: 100%; | ||
height: 300px; | ||
} | ||
</style> |
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
Binary file not shown.
Oops, something went wrong.