|
@@ -95,17 +95,18 @@ export default {
|
|
|
});
|
|
|
text3d_renderer.setSize(this.width, this.height);
|
|
|
|
|
|
- const ground = new THREE.Mesh(new THREE.PlaneGeometry(100, 100), new THREE.MeshPhongMaterial({ color: "#eee" }));
|
|
|
- ground.translateZ(-0.01);
|
|
|
- ground.object_id = "ground";
|
|
|
- this.scene.add(ground);
|
|
|
-
|
|
|
- const grid = new THREE.GridHelper(100, 100);
|
|
|
- grid.material.transparent = true;
|
|
|
- grid.material.opacity = 0.2;
|
|
|
- grid.rotateX(Math.PI / 2);
|
|
|
- this.scene.add(grid);
|
|
|
+ if (this.grid) {
|
|
|
+ const ground = new THREE.Mesh(new THREE.PlaneGeometry(100, 100), new THREE.MeshPhongMaterial({ color: "#eee" }));
|
|
|
+ ground.translateZ(-0.01);
|
|
|
+ ground.object_id = "ground";
|
|
|
+ this.scene.add(ground);
|
|
|
|
|
|
+ const grid = new THREE.GridHelper(100, 100);
|
|
|
+ grid.material.transparent = true;
|
|
|
+ grid.material.opacity = 0.2;
|
|
|
+ grid.rotateX(Math.PI / 2);
|
|
|
+ this.scene.add(grid);
|
|
|
+ }
|
|
|
this.controls = new THREE.OrbitControls(this.camera, renderer.domElement);
|
|
|
|
|
|
const render = () => {
|
|
@@ -348,5 +349,6 @@ export default {
|
|
|
props: {
|
|
|
width: Number,
|
|
|
height: Number,
|
|
|
+ grid: Boolean,
|
|
|
},
|
|
|
};
|