mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
wip (meshes)
This commit is contained in:
parent
f82a7d5ab4
commit
216c44deaf
@ -1,2 +0,0 @@
|
||||
ren *.js *.ts
|
||||
pause
|
@ -1,4 +0,0 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/BoxGeometry.js';
|
||||
|
||||
export default meshComponent('Box', props, createGeometry);
|
4
src/meshes/Box.ts
Normal file
4
src/meshes/Box.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/BoxGeometry.js'
|
||||
|
||||
export default meshComponent('Box', props, createGeometry)
|
@ -1,4 +0,0 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/CircleGeometry.js';
|
||||
|
||||
export default meshComponent('Circle', props, createGeometry);
|
4
src/meshes/Circle.ts
Normal file
4
src/meshes/Circle.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/CircleGeometry.js'
|
||||
|
||||
export default meshComponent('Circle', props, createGeometry)
|
@ -1,4 +0,0 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/ConeGeometry.js';
|
||||
|
||||
export default meshComponent('Cone', props, createGeometry);
|
4
src/meshes/Cone.ts
Normal file
4
src/meshes/Cone.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/ConeGeometry.js'
|
||||
|
||||
export default meshComponent('Cone', props, createGeometry)
|
@ -1,4 +0,0 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/CylinderGeometry.js';
|
||||
|
||||
export default meshComponent('Cylinder', props, createGeometry);
|
4
src/meshes/Cylinder.ts
Normal file
4
src/meshes/Cylinder.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/CylinderGeometry.js'
|
||||
|
||||
export default meshComponent('Cylinder', props, createGeometry)
|
@ -1,4 +1,4 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/DodecahedronGeometry.js';
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/DodecahedronGeometry.js'
|
||||
|
||||
export default meshComponent('Dodecahedron', props, createGeometry);
|
||||
export default meshComponent('Dodecahedron', props, createGeometry)
|
@ -1,4 +1,4 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/IcosahedronGeometry.js';
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/IcosahedronGeometry.js'
|
||||
|
||||
export default meshComponent('Icosahedron', props, createGeometry);
|
||||
export default meshComponent('Icosahedron', props, createGeometry)
|
@ -1,4 +0,0 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/LatheGeometry.js';
|
||||
|
||||
export default meshComponent('Lathe', props, createGeometry);
|
4
src/meshes/Lathe.ts
Normal file
4
src/meshes/Lathe.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/LatheGeometry.js'
|
||||
|
||||
export default meshComponent('Lathe', props, createGeometry)
|
@ -1,4 +1,4 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/OctahedronGeometry.js';
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/OctahedronGeometry.js'
|
||||
|
||||
export default meshComponent('Octahedron', props, createGeometry);
|
||||
export default meshComponent('Octahedron', props, createGeometry)
|
@ -1,4 +0,0 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/PlaneGeometry.js';
|
||||
|
||||
export default meshComponent('Plane', props, createGeometry);
|
4
src/meshes/Plane.ts
Normal file
4
src/meshes/Plane.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/PlaneGeometry.js'
|
||||
|
||||
export default meshComponent('Plane', props, createGeometry)
|
@ -1,4 +1,4 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/PolyhedronGeometry.js';
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/PolyhedronGeometry.js'
|
||||
|
||||
export default meshComponent('Polyhedron', props, createGeometry);
|
||||
export default meshComponent('Polyhedron', props, createGeometry)
|
@ -1,4 +0,0 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/RingGeometry.js';
|
||||
|
||||
export default meshComponent('Ring', props, createGeometry);
|
4
src/meshes/Ring.ts
Normal file
4
src/meshes/Ring.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/RingGeometry.js'
|
||||
|
||||
export default meshComponent('Ring', props, createGeometry)
|
@ -1,4 +0,0 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/SphereGeometry.js';
|
||||
|
||||
export default meshComponent('Sphere', props, createGeometry);
|
4
src/meshes/Sphere.ts
Normal file
4
src/meshes/Sphere.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/SphereGeometry.js'
|
||||
|
||||
export default meshComponent('Sphere', props, createGeometry)
|
@ -1,4 +1,4 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/TetrahedronGeometry.js';
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/TetrahedronGeometry.js'
|
||||
|
||||
export default meshComponent('Tetrahedron', props, createGeometry);
|
||||
export default meshComponent('Tetrahedron', props, createGeometry)
|
@ -1,4 +0,0 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/TorusGeometry.js';
|
||||
|
||||
export default meshComponent('Torus', props, createGeometry);
|
4
src/meshes/Torus.ts
Normal file
4
src/meshes/Torus.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/TorusGeometry.js'
|
||||
|
||||
export default meshComponent('Torus', props, createGeometry)
|
@ -1,4 +1,4 @@
|
||||
import { meshComponent } from './Mesh.js';
|
||||
import { props, createGeometry } from '../geometries/TorusKnotGeometry.js';
|
||||
import { meshComponent } from './Mesh'
|
||||
import { props, createGeometry } from '../geometries/TorusKnotGeometry.js'
|
||||
|
||||
export default meshComponent('TorusKnot', props, createGeometry);
|
||||
export default meshComponent('TorusKnot', props, createGeometry)
|
@ -1,22 +1,22 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import Mesh from './Mesh.js';
|
||||
import { props, createGeometry, updateTubeGeometryPoints } from '../geometries/TubeGeometry.js';
|
||||
import { defineComponent } from 'vue'
|
||||
import Mesh from './Mesh'
|
||||
import { props, createGeometry, updateTubeGeometryPoints } from '../geometries/TubeGeometry.js'
|
||||
|
||||
export default defineComponent({
|
||||
extends: Mesh,
|
||||
props,
|
||||
created() {
|
||||
this.createGeometry();
|
||||
this.addGeometryWatchers(props);
|
||||
this.createGeometry()
|
||||
this.addGeometryWatchers(props)
|
||||
},
|
||||
methods: {
|
||||
createGeometry() {
|
||||
this.geometry = createGeometry(this);
|
||||
this.geometry = createGeometry(this)
|
||||
},
|
||||
// update curve points (without using prop, faster)
|
||||
updatePoints(points) {
|
||||
updateTubeGeometryPoints(this.geometry, points);
|
||||
updateTubeGeometryPoints(this.geometry, points)
|
||||
},
|
||||
},
|
||||
__hmrId: 'Tube',
|
||||
});
|
||||
})
|
@ -1,23 +1,23 @@
|
||||
export { default as Mesh } from './Mesh.js';
|
||||
export { default as Mesh } from './Mesh'
|
||||
|
||||
export { default as Box } from './Box.js';
|
||||
export { default as Circle } from './Circle.js';
|
||||
export { default as Cone } from './Cone.js';
|
||||
export { default as Cylinder } from './Cylinder.js';
|
||||
export { default as Dodecahedron } from './Dodecahedron.js';
|
||||
export { default as Icosahedron } from './Icosahedron.js';
|
||||
export { default as Lathe } from './Lathe.js';
|
||||
export { default as Octahedron } from './Octahedron.js';
|
||||
export { default as Plane } from './Plane.js';
|
||||
export { default as Polyhedron } from './Polyhedron.js';
|
||||
export { default as Ring } from './Ring.js';
|
||||
export { default as Sphere } from './Sphere.js';
|
||||
export { default as Tetrahedron } from './Tetrahedron.js';
|
||||
export { default as Text } from './Text.js';
|
||||
export { default as Torus } from './Torus.js';
|
||||
export { default as TorusKnot } from './TorusKnot.js';
|
||||
export { default as Tube } from './Tube.js';
|
||||
export { default as Box } from './Box'
|
||||
export { default as Circle } from './Circle'
|
||||
export { default as Cone } from './Cone'
|
||||
export { default as Cylinder } from './Cylinder'
|
||||
export { default as Dodecahedron } from './Dodecahedron'
|
||||
export { default as Icosahedron } from './Icosahedron'
|
||||
export { default as Lathe } from './Lathe'
|
||||
export { default as Octahedron } from './Octahedron'
|
||||
export { default as Plane } from './Plane'
|
||||
export { default as Polyhedron } from './Polyhedron'
|
||||
export { default as Ring } from './Ring'
|
||||
export { default as Sphere } from './Sphere'
|
||||
export { default as Tetrahedron } from './Tetrahedron'
|
||||
export { default as Text } from './Text'
|
||||
export { default as Torus } from './Torus'
|
||||
export { default as TorusKnot } from './TorusKnot'
|
||||
export { default as Tube } from './Tube'
|
||||
|
||||
export { default as Image } from './Image.js';
|
||||
export { default as InstancedMesh } from './InstancedMesh.js';
|
||||
export { default as Sprite } from './Sprite.js';
|
||||
export { default as Image } from './Image'
|
||||
export { default as InstancedMesh } from './InstancedMesh'
|
||||
export { default as Sprite } from './Sprite'
|
||||
|
Loading…
Reference in New Issue
Block a user