x_ite-node
v1.0.4
Published
Pure Node.js wrapper of X_ITE
Downloads
278
Maintainers
Readme
x_ite-node
This is a wrapper for X_ITE for use in a plain Node.js environment. The purpose of this module is to provide a version of X_ITE that can load X3D files, modify or process them, and generate X3D files.
There is no way to render images or anything like that, use X_ITE in an Electron environment for that.
Installation
npm i x_ite-node
Usage
const
X3D = require ("x_ite-node"),
canvas = X3D .createBrowser (),
browser = canvas .browser,
scene = browser .currentScene;
async function main ()
{
// Add and load required profile and components:
scene .setProfile (browser .getProfile ("Interchange"));
scene .addComponent (browser .getComponent ("Interpolation", 1));
await browser .loadComponents (scene);
// Create and add some nodes to scene:
scene .rootNodes .push (scene .createNode ("Transform"));
...
// Generate XML file:
console .log (scene .toXMLString ());
}
main ();
Useful information on how to access the external browser and documentation on all X_ITE functions can be found via the following links: