diff --git a/src/meshes/Box.js b/src/meshes/Box.js index b18a0ad..e3182df 100644 --- a/src/meshes/Box.js +++ b/src/meshes/Box.js @@ -1,7 +1,4 @@ -import { - BoxBufferGeometry, -} from 'three'; - +import { BoxBufferGeometry } from 'three'; import Mesh from './Mesh.js'; export default { diff --git a/src/meshes/Plane.js b/src/meshes/Plane.js new file mode 100644 index 0000000..312fc68 --- /dev/null +++ b/src/meshes/Plane.js @@ -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); + }, +}; diff --git a/src/meshes/Sphere.js b/src/meshes/Sphere.js index dd440ef..a2692fc 100644 --- a/src/meshes/Sphere.js +++ b/src/meshes/Sphere.js @@ -1,7 +1,4 @@ -import { - SphereBufferGeometry, -} from 'three'; - +import { SphereBufferGeometry } from 'three'; import Mesh from './Mesh.js'; export default {