Script TS TypeScript Free

Smart 3D Models

Smart 3D Models picture
Author
matas
Created
Oct 31, 2023, 1:38:49 PM
Last edit
Dec 5, 2023, 2:09:23 PM

Edit scriptPreview

Project

Bitbybit For BabylonJS Developers

The course that introduces the bitbybit.dev platform to BabylonJS developers.

View full project
const engine = bitbybit.babylon.engine.getEngine();

const scene = new BABYLON.Scene(engine);
bitbybit.babylon.scene.setAndAttachScene({ scene });

var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(100, 30, -100), scene);
camera.setTarget(new BABYLON.Vector3(0, 5, 0));

const canvas = bitbybit.babylon.engine.getRenderingCanvas();

camera.attachControl(canvas, true);
camera.speed = 1;
camera.minZ = 0;

const light = new BABYLON.HemisphericLight("HemiLight", new BABYLON.Vector3(0, 1, 0), scene);
light.intensityMode = BABYLON.Light.INTENSITYMODE_ILLUMINANCE;
light.intensity = 1;

const start = async () => {

    const birdhouseOptions = new Bit.Things.KidsCorner.BirdHouses.ChirpyChalet.ChirpyChaletDto();
    const birdhouse = await bitbybit.things.kidsCorner.birdhouses.chirpyChalet.create(birdhouseOptions);

    const mesh = await bitbybit.draw.drawAnyAsync({
        entity: birdhouse
    });

    for (let x = -100; x < 100; x += 10) {
        for (let z = -100; z < 100; z += 10) {
            const allChildren = mesh.getChildMeshes();
            allChildren.forEach((c: BABYLON.Mesh) => {
                const instancedMesh = c.createInstance(`${x}-${z}`);
                instancedMesh.position = new BABYLON.Vector3(x, 0, z);
            })
        }
    }

}

start();

Plans and pricing

Choose your plan

Editor plans for 3D development, API keys for server-side CAD algorithms

EnterpriseB2BCustompricing

Custom software development, dedicated servers and CAD automation at scale.

Learn moreContact us

CAD automation and software
  • Custom software development
  • Cloud CAD automation pipelines
  • 3D configurators (STEP & GLTF)
  • Batch export jobs
  • Custom algorithms & deployment
Infrastructure and support
  • Custom compute allocation
  • Dedicated / VPS server tenants
  • Long-running computation jobs
  • Custom upload limits & overage
  • SLA & premium support

All prices exclude applicable taxesView all plan details

Contact

Talk to us

Tell us what you are building or what is blocking you, through whichever channel suits you.