setBackground("#111827");
setCamera([0, 5, 12], [0, 1.2, 0]);
const shapes = [
new THREE.SphereGeometry(0.8, 48, 48),
new THREE.TorusKnotGeometry(0.55, 0.2, 128, 24),
new THREE.IcosahedronGeometry(0.95, 0),
];
const materials = [
new THREE.MeshStandardMaterial({
color: "#f97316",
roughness: 0.15,
metalness: 0.85,
}),
new THREE.MeshStandardMaterial({
color: "#22c55e",
roughness: 0.9,
metalness: 0.05,
}),
new THREE.MeshNormalMaterial(),
];
const meshes = shapes.map((geometry, index) => {
const mesh = new THREE.Mesh(geometry, materials[index]);
mesh.position.set((index - 1) * 3, 1.2, 0);
scene.add(mesh);
return mesh;
});
const floor = new THREE.Mesh(
new THREE.PlaneGeometry(18, 18),
new THREE.ShadowMaterial({ opacity: 0.18 })
);
floor.rotation.x = -Math.PI / 2;
floor.position.y = -0.4;
scene.add(floor);
onFrame(({ elapsedTime }) => {
meshes.forEach((mesh, index) => {
mesh.rotation.x = elapsedTime * (0.45 + index * 0.1);
mesh.rotation.y = elapsedTime * (0.7 + index * 0.18);
});
});