Skip to main content

Getting Started

Installation

npm install real_api

Usage

  • Normal Three.js Scene
import * as REAL from "real_api";

const blob = await REAL.Scene(scene, camera);
  • Any 3D mesh
const filePath = "test.gltf" // Local GLTF, GLB, FBX etc
const buffer = await new Promise((resolve, reject) => {
// code for loading local file into buffer
});
const blob = new Blob([buffer], {type: 'application/octet-stream'});

Create new job

import * as REAL from "real_api";

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

const params = {
"prodCred": {
"insID": 0,
"appKey": "ABC",
"prodKey": "XYZ"
},
"type": "new",
"render": {
"expFrom": "3js"
}
}

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

Upload scene

 const request = await axios.put(uploadUri, blob);

Submit job

const params = {
"prodCred": {
"insID": 0,
"appKey": "ABC",
"prodKey": "XYZ"
},
"type": "render",
"jobID": "1703925059_301526"
}

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