JSPM

  • Created
  • Published
  • Downloads 106
  • Score
    100M100P100Q85453F
  • License MIT

Pure Node.js wrapper of X_ITE

Package Exports

  • x_ite-node
  • x_ite-node/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (x_ite-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

x_ite-node

npm Version npm Downloads DeepScan grade

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");

async function main ()
{
   // Create browser and scene:

   const
      canvas  = X3D .createBrowser (),
      browser = canvas .browser,
      scene   = await browser .createScene (browser .getProfile ("Interchange"), browser .getComponent ("Interpolation", 1));

   // Create and add some nodes to scene:

   scene .rootNodes .push (scene .createNode ("Transform"));
   ...

   // Generate XML file:

   console .log (scene .toXMLString ());

   // Always call dispose at end!
   browser .dispose ();
}

main ();

Useful information on how to access the external browser and documentation of all X_ITE functions can be found via the following links:

See Also