1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00
This commit is contained in:
Kevin Levron 2020-10-04 00:49:05 +02:00
parent de0761812a
commit 08bc80d1cf
9 changed files with 2621 additions and 295 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
</head> </head>
<body> <body>
<div id="app"></div> <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 --> <!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-178028522-1"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-178028522-1"></script>

View File

@ -1,13 +1,12 @@
{ {
"name": "troisjs", "name": "troisjs",
"version": "0.0.9", "version": "0.1.0",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"rollup": "rollup -c" "rollup": "rollup -c"
}, },
"dependencies": { "dependencies": {
"chroma-js": "^2.1.0",
"gsap": "^3.5.1", "gsap": "^3.5.1",
"three": "^0.120" "three": "^0.120"
}, },

View File

@ -2,17 +2,24 @@ import commonjs from '@rollup/plugin-commonjs';
import vue from 'rollup-plugin-vue'; import vue from 'rollup-plugin-vue';
import buble from '@rollup/plugin-buble'; import buble from '@rollup/plugin-buble';
import { terser } from "rollup-plugin-terser"; import { terser } from "rollup-plugin-terser";
// import replace from '@rollup/plugin-replace';
const input = 'src/index.js'; const input = 'src/export.js';
const external = [ const external = [
'three', 'three',
'three/examples/jsm/controls/OrbitControls.js', '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/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/RenderPass.js',
'three/examples/jsm/postprocessing/SAOPass.js',
'three/examples/jsm/postprocessing/UnrealBloomPass.js', 'three/examples/jsm/postprocessing/UnrealBloomPass.js',
'gsap',
'vue', 'vue',
]; ];
const plugins = [ const plugins = [
commonjs(), commonjs(),
vue(), vue(),
@ -23,6 +30,74 @@ const plugins = [
]; ];
export default [ 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/three@0.120.1/build/three.module.js\'',
// 'from \'three/examples': 'from \'https://unpkg.com/three@0.120.1/examples',
// 'from \'gsap\'': 'from \'https://unpkg.com/gsap@3.5.1/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/three@0.120.1/build/three.module.js\'',
// 'from \'three/examples': 'from \'https://unpkg.com/three@0.120.1/examples',
// 'from \'gsap\'': 'from \'https://unpkg.com/gsap@3.5.1/index.js\'',
// delimiters: ['', ''],
// }),
// ...plugins,
// terser(),
// ],
// },
{ {
input, input,
external, external,
@ -53,7 +128,7 @@ export default [
external, external,
output: { output: {
format: 'cjs', format: 'cjs',
file: 'dist/trois.js', file: 'build/trois.js',
sourcemap: true, sourcemap: true,
}, },
plugins, plugins,
@ -63,7 +138,7 @@ export default [
external, external,
output: { output: {
format: 'cjs', format: 'cjs',
file: 'dist/trois.min.js', file: 'build/trois.min.js',
sourcemap: true, sourcemap: true,
}, },
plugins: [ plugins: [

View File

@ -42,17 +42,17 @@
<PhysicalMaterial flat-shading /> <PhysicalMaterial flat-shading />
</NoisySphere> --> </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" /> <DodecahedronGeometry :radius="8" />
<StandardMaterial color="#ffffff" :metalness="1" :roughness="0" /> <StandardMaterial color="#ffffff" :metalness="1" :roughness="0" />
</MirrorMesh> </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" /> <TorusGeometry :radius="8" :tube="3" />
<StandardMaterial color="#ffffff" :metalness="1" :roughness="0" /> <StandardMaterial color="#ffffff" :metalness="1" :roughness="0" />
</RefractionMesh> </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" /> <DodecahedronGeometry :radius="8" />
<StandardMaterial color="#0000ff" :metalness="1" :roughness="0" /> <StandardMaterial color="#0000ff" :metalness="1" :roughness="0" />
</Gem> </Gem>