Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

osg-serializer-browser

MikesWei8ISC0.0.3

Module for reading and writing OpenSceneGraph 3D models. file type supported: .osgb .osgt

OpenSceneGraph, osgb, osgt

readme

osg-serializer-browser

osg-serializier-js is PureJS module for serializing .osgt and .osgb files.

The tool is still in development but I will be happy to your issues and contributions

UPDATE: Consider using wasm using OpenSceneGraph's most updated code (osg-wasm, openscenegraph-cross-platform-guide).

installation and usage

In terminal: npm install --save osg-serializer-browser

In code(node.js):

var filePath = './Samples/cessna.osgb'
osg.readFile(filePath, (err, osgObj) => {
    if (err) console.error(err);
    else console.log(osgObj);
    // start workin with 3d data
})

In code(browser):

<script src='./dist/osg.js'></script>

var buffer = require('buffer')
var filePath = './Samples/cessna.osgb'
fetch(filePath).then(res => { return res.arrayBuffer() }).then(abuf => {
    var buf = buffer.Buffer.from(abuf)
    var osgObj = osg.readBuffer(buf, filePath)
    console.log(osgObj);
})

// start workin with 3d data