Skip to content

Commit

Permalink
0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
klevron committed Oct 3, 2020
1 parent de07618 commit 08bc80d
Show file tree
Hide file tree
Showing 9 changed files with 2,687 additions and 361 deletions.
2,942 changes: 2,597 additions & 345 deletions build/trois.module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/trois.module.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/trois.module.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/trois.module.min.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/index.891a7ba5.js → docs/index.10d78495.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>
<body>
<div id="app"></div>
<script type="module" src="index.891a7ba5.js"></script>
<script type="module" src="index.10d78495.js"></script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-178028522-1"></script>
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "troisjs",
"version": "0.0.9",
"version": "0.1.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"rollup": "rollup -c"
},
"dependencies": {
"chroma-js": "^2.1.0",
"gsap": "^3.5.1",
"three": "^0.120"
},
Expand Down
83 changes: 79 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@ import commonjs from '@rollup/plugin-commonjs';
import vue from 'rollup-plugin-vue';
import buble from '@rollup/plugin-buble';
import { terser } from "rollup-plugin-terser";
// import replace from '@rollup/plugin-replace';

const input = 'src/index.js';
const input = 'src/export.js';
const external = [
'three',
'three/examples/jsm/controls/OrbitControls.js',
'three/examples/jsm/postprocessing/EffectComposer.js',
'three/examples/jsm/loaders/GLTFLoader.js',
'three/examples/jsm/postprocessing/BokehPass.js',
'three/examples/jsm/postprocessing/EffectComposer.js',
'three/examples/jsm/postprocessing/FilmPass.js',
'three/examples/jsm/postprocessing/HalftonePass.js',
'three/examples/jsm/postprocessing/RenderPass.js',
'three/examples/jsm/postprocessing/SAOPass.js',
'three/examples/jsm/postprocessing/UnrealBloomPass.js',
'gsap',
'vue',
];

const plugins = [
commonjs(),
vue(),
Expand All @@ -23,6 +30,74 @@ const plugins = [
];

export default [
// {
// input,
// external,
// output: {
// format: 'umd',
// name: 'TroisJS',
// file: 'build/trois.umd.js',
// sourcemap: true,
// globals: {
// 'three': 'THREE',
// 'vue': 'Vue',
// },
// },
// plugins,
// },
// {
// input,
// external,
// output: {
// format: 'umd',
// name: 'TroisJS',
// file: 'build/trois.umd.min.js',
// sourcemap: true,
// },
// plugins: [
// ...plugins,
// terser(),
// ],
// },
// {
// input,
// external,
// output: {
// format: 'es',
// exports: 'named',
// file: 'build/trois.module.cdn.js',
// sourcemap: true,
// },
// plugins: [
// replace({
// 'from \'three\'': 'from \'https://unpkg.com/[email protected]/build/three.module.js\'',
// 'from \'three/examples': 'from \'https://unpkg.com/[email protected]/examples',
// 'from \'gsap\'': 'from \'https://unpkg.com/[email protected]/index.js\'',
// delimiters: ['', ''],
// }),
// ...plugins,
// ],
// },
// {
// input,
// external,
// output: {
// format: 'es',
// exports: 'named',
// file: 'build/trois.module.cdn.min.js',
// sourcemap: true,
// },
// plugins: [
// replace({
// 'from \'three\'': 'from \'https://unpkg.com/[email protected]/build/three.module.js\'',
// 'from \'three/examples': 'from \'https://unpkg.com/[email protected]/examples',
// 'from \'gsap\'': 'from \'https://unpkg.com/[email protected]/index.js\'',
// delimiters: ['', ''],
// }),
// ...plugins,
// terser(),
// ],
// },
{
input,
external,
Expand Down Expand Up @@ -53,7 +128,7 @@ export default [
external,
output: {
format: 'cjs',
file: 'dist/trois.js',
file: 'build/trois.js',
sourcemap: true,
},
plugins,
Expand All @@ -63,7 +138,7 @@ export default [
external,
output: {
format: 'cjs',
file: 'dist/trois.min.js',
file: 'build/trois.min.js',
sourcemap: true,
},
plugins: [
Expand Down
6 changes: 3 additions & 3 deletions src/components/demos/Demo1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@
<PhysicalMaterial flat-shading />
</NoisySphere> -->

<MirrorMesh ref="mesh1" :position="{ x: -30, y: -15, z: 20 }" auto-update>
<MirrorMesh ref="mesh1" :position="{ x: -30, y: -20, z: 15 }" auto-update>
<DodecahedronGeometry :radius="8" />
<StandardMaterial color="#ffffff" :metalness="1" :roughness="0" />
</MirrorMesh>

<RefractionMesh ref="mesh2" :position="{ x: 0, y: -15, z: 20 }" auto-update>
<RefractionMesh ref="mesh2" :position="{ x: 0, y: -20, z: 15 }" auto-update>
<TorusGeometry :radius="8" :tube="3" />
<StandardMaterial color="#ffffff" :metalness="1" :roughness="0" />
</RefractionMesh>

<Gem ref="mesh3" :position="{ x: 30, y: -15, z: 20 }" auto-update>
<Gem ref="mesh3" :position="{ x: 30, y: -20, z: 15 }" auto-update>
<DodecahedronGeometry :radius="8" />
<StandardMaterial color="#0000ff" :metalness="1" :roughness="0" />
</Gem>
Expand Down

0 comments on commit 08bc80d

Please sign in to comment.