tolw
WebAssembly port of tinyobjloader
Install:
npm install tolw
Usage:
const tolw = ;// initialise tolwtolw;
Example:
let vertices = ;let indices = ;for let shape of shapes for let index of shapemeshindices let pos = x: attribvertices3 * indexvertex_index + 0 y: attribvertices3 * indexvertex_index + 2 z: attribvertices3 * indexvertex_index + 1 ; let normal = x: attribnormals3 * indexnormal_index + 0 y: attribnormals3 * indexnormal_index + 2 z: attribnormals3 * indexnormal_index + 1 ; let texCoord = x: attribtexcoords2 * indextexcoord_index + 0 y: 10 - attribtexcoords2 * indextexcoord_index + 1 ; vertices; indices; ;;
Build:
em++ --bind -o tolw.js tolw.cc -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s NODEJS_CATCH_EXIT -O3