real_api_bbl
TypeScript icon, indicating that this package has built-in type declarations

1.0.71 • Public • Published

real_api_bbl

npm release Documentation License

Render babylon.js scene at run time

alt output2 alt output2

Installation

npm install real_api_bbl

Documentation

Documentation

Render a job

Requirements:

Getting started

Import:

import * as REAL from "real_api_bbl";
Step 3: Create new job
import * as REAL from "real_api_bbl";

const uri = `https://${REAL.Domain}/rapi/ask_service`;

const params = {
    "prodCred": {
        "insID": 0,
        "appKey": "ABC",
        "prodKey": "XYZ"
    },
    "ask": "new_job",
    "renderParams": {
        "expFrom": "3js"
    }
}

const response = await axios.post(uri, params);
Step 4: Upload scene
const renderScene = await REAL.Scene(scene, camera);
const request = await axios.put(uploadUri, renderScene);
Step 5: Submit job
import * as REAL from "real_api_bbl";

const uri = `https://${REAL.Domain}/rapi/ask_service`;

const params = {
    "prodCred": {
        "insID": 0,
        "appKey": "ABC",
        "prodKey": "XYZ"
    },
    "ask": "submit",
    "service": {
        "jobID": jobID
    }
}

const response = await axios.post(uri, params);

Check job status

More features:

Area light

const options = {
    width: 1,
    height: 2,
    intensity: 2,
    diffuse: new BABYLON.Color3(0.66, 0.56, 0.2)
}
const light = new REAL.AreaLight(scene, options);

Sunlight

const options = {
    intensity: 2,
    shadowEnabled: true,
    diffuse: new BABYLON.Color3(0.66, 0.56, 0.2)
}
const light = new REAL.SunLight(scene, options);

Point Light

const options = {
    range: 20,
    intensity: 2,
    shadowEnabled: true,
    diffuse: new BABYLON.Color3(0.66, 0.56, 0.2)
}
const light = new REAL.PointLight(scene, options);

Spotlight

const options = {
    range: 20,
    angle: 1.5,
    intensity: 2,
    shadowEnabled: true,
    diffuse: new BABYLON.Color3(0.66, 0.56, 0.2)
}
const light = new REAL.SpotLight(scene, options);

Package Sidebar

Install

npm i real_api_bbl

Weekly Downloads

12

Version

1.0.71

License

CSL

Unpacked Size

138 kB

Total Files

5

Last publish

Collaborators

  • usmanheart_ou