1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

add plane mesh

This commit is contained in:
Kevin Levron 2020-09-15 16:21:07 +02:00
parent 924d5092a2
commit 207fbc3f70
3 changed files with 29 additions and 8 deletions

View File

@ -1,7 +1,4 @@
import { import { BoxBufferGeometry } from 'three';
BoxBufferGeometry,
} from 'three';
import Mesh from './Mesh.js'; import Mesh from './Mesh.js';
export default { export default {

27
src/meshes/Plane.js Normal file
View File

@ -0,0 +1,27 @@
import { PlaneBufferGeometry } from 'three';
import Mesh from './Mesh.js';
export default {
extends: Mesh,
props: {
width: {
type: Number,
default: 1,
},
height: {
type: Number,
default: 1,
},
widthSegments: {
type: Number,
default: 1,
},
heightSegments: {
type: Number,
default: 1,
},
},
created() {
this.geometry = new PlaneBufferGeometry(this.width, this.height, this.widthSegments, this.heightSegments);
},
};

View File

@ -1,7 +1,4 @@
import { import { SphereBufferGeometry } from 'three';
SphereBufferGeometry,
} from 'three';
import Mesh from './Mesh.js'; import Mesh from './Mesh.js';
export default { export default {