Skip to content

create3000/x_ite-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ());
}

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