Skip to content

Commit d209dc1

Browse files
committed
feat: VglObjLoader as example component
1 parent 0143648 commit d209dc1

31 files changed

+367058
-227
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/js/
22
/components/
3+
/examples/*/

_examples-ex/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* globals Vue */
2+
3+
import VglObjLoaderExample from './loaders/vgl-obj-loader.vue';
4+
5+
const examples = {
6+
VglObjLoaderExample,
7+
};
8+
9+
Object.entries(examples).forEach(([name, component]) => Vue.component(name, component));
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<vgl-renderer>
3+
<vgl-scene>
4+
<vgl-obj-loader src="/obj/seahorse.obj" />
5+
<vgl-ambient-light intensity="0.5" />
6+
<vgl-directional-light
7+
position="1 1 1"
8+
intensity="0.5"
9+
/>
10+
</vgl-scene>
11+
<vgl-perspective-camera
12+
orbit-position="300 1 0.2"
13+
orbit-target="0 0 -300"
14+
/>
15+
</vgl-renderer>
16+
</template>

_examples/geometries/vgl-text-geometry.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<vgl-scene>
55
<vgl-text-geometry
66
name="text"
7-
font="/js/helvetiker_regular.typeface.json"
7+
font="/js/vendor/helvetiker_regular.typeface.json"
88
:text="text"
99
/>
1010
<vgl-mesh-standard-material name="std" />

_includes/head_custom.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
></script>
77
{% endif %}
88

9-
<script src="{{ '/js/vue.min.js' | relative_url }}"></script>
10-
<script src="{{ '/js/three.min.js' | relative_url }}"></script>
9+
<script src="{{ '/js/vendor/vue.min.js' | relative_url }}"></script>
10+
<script src="{{ '/js/vendor/three.min.js' | relative_url }}"></script>
1111
<script src="{{ '/js/vue-gl.js' | relative_url }}"></script>
1212
<script src="{{ '/js/examples.js' | relative_url }}"></script>
13+
<script src="{{ '/js/examples-ex.js' | relative_url }}"></script>

_rollup/rollup-plugin-generate-component-documents.js

Lines changed: 0 additions & 162 deletions
This file was deleted.

examples/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
has_children: true
3+
nav_order: D
4+
---
5+
# API / Example Components
6+
7+
## Trying example components
8+
9+
Each example components are built standalone under the [dist/js/examples](https://unpkg.com/browse/vue-gl/dist/examples/).
10+
To use them, load scripts directly with `<script>` element after loading VueGL or
11+
import with module bundlers.
12+
13+
When load scripts directly, the component will be injected under the `VueGL` namespace.
14+
Resister `VueGL.<ComponentName>` to `Vue` before instantiating the components.

guide/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
nav_order: 2
2+
nav_order: B
33
parent: Guide
44
---
55

guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
nav_order: 1
2+
nav_order: A
33
has_children: true
44
---
55
# Guide

guide/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
parent: Guide
3-
nav_order: 1
3+
nav_order: A
44
---
55
# Installation
66
{: .no_toc}

0 commit comments

Comments
 (0)