baseplane, root-object offset, saveKF & resetKF buttons...

This commit is contained in:
STEINNI
2025-10-21 15:55:22 +00:00
parent 36776162ec
commit aa76bfe9c0
6 changed files with 67 additions and 14 deletions
+15 -2
View File
@@ -33,10 +33,23 @@ export class kfArena{
this.scene.add(light)
this.scene.add(new THREE.AmbientLight(0xffffff, 0.4))
this.grid = new THREE.GridHelper(this.sceneSize.x, this.sceneSize.y, 0x8888AA, 0x8888AA)
this.grid = new THREE.GridHelper(this.sceneSize.x, this.sceneSize.x, 0x8888AA, 0x8888AA)
this.grid.layers.set(1)
this.scene.add(this.grid)
// Base plane
const planeGeo = new THREE.PlaneGeometry(100, 100)
const planeMat = new THREE.MeshBasicMaterial({
color: 0xaaaacc,
opacity: 0.3,
transparent: true, // needed for opacity < 1 to take effect
side: THREE.DoubleSide
})
this.basePlane = new THREE.Mesh(planeGeo, planeMat)
this.basePlane.rotation.x = -Math.PI / 2 // lay it flat (like the grid)
this.basePlane.position.y=-0.01 // to avoid artefacts on objets bases
this.scene.add(this.basePlane)
this.axes = new THREE.AxesHelper(this.sceneSize.x/2, this.sceneSize.y/2)
this.axes.layers.set(2)
this.scene.add(this.axes)