mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 20:32:02 +08:00
24 lines
558 B
JavaScript
24 lines
558 B
JavaScript
|
import { PlaneGeometry } from 'three';
|
||
|
import Geometry from './Geometry.js';
|
||
|
|
||
|
export const props = {
|
||
|
width: { type: Number, default: 1 },
|
||
|
height: { type: Number, default: 1 },
|
||
|
widthSegments: { type: Number, default: 1 },
|
||
|
heightSegments: { type: Number, default: 1 },
|
||
|
};
|
||
|
|
||
|
export function createGeometry(comp) {
|
||
|
return new PlaneGeometry(comp.width, comp.height, comp.widthSegments, comp.heightSegments);
|
||
|
};
|
||
|
|
||
|
export default {
|
||
|
extends: Geometry,
|
||
|
props,
|
||
|
methods: {
|
||
|
createGeometry() {
|
||
|
this.geometry = createGeometry(this);
|
||
|
},
|
||
|
},
|
||
|
};
|