add a box
import { ArcRotateCamera, HemisphericLight, MeshBuilder, Scene, Vector3 } from "@babylonjs/core";
import { createApp } from "../utils";
const app = createApp((canvas, engine) => {
const scene = new Scene(engine);
const camera = new ArcRotateCamera("camera", -Math.PI/2, Math.PI/2.5, 15, Vector3.Zero(), scene);
camera.attachControl(canvas, true);
const light = new HemisphericLight('light', new Vector3(1, 1, 0), scene);
// customize your scene here
const ground = MeshBuilder.CreateGround("ground", {width: 10, height: 10}, scene);
const box = MeshBuilder.CreateBox("box", {width: 1, height: 1, depth: 1}, scene);
return scene;
})
app.run();
reposition box
box.position.y = 0.5