New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

collada-dae-parser

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collada-dae-parser

Parse collada .dae 3d animation files into json

  • 0.7.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
109
decreased by-21.01%
Maintainers
1
Weekly downloads
 
Created
Source

collada-dae-parser npm version Build Status

Parse collada .dae file vertex positions, textures, normals and animations

View live animated model

View demo source

Notice

This package is still a work in progress (hence no major bump)

I won't need skeletal animations until around September. Commits will be few and far between until then.

But.. I'm still around. If you have a question, ideas or use cases that aren't covered open an issue!

What does it do?

collada-dae-parser parses a collada file and outputs JSON. This is useful for displaying skeletal animations in the browser.

collada-dae-parser is only concerned with giving you JSON. An animation system is outside of this modules scope.

To Install

# API
$ npm install --save collada-dae-parser
# CLI
$ npm install -g collada-dae-parser

Making use of the parser

If you're unfamiliar with skeletal animation, the demo is a good starting point. Here's where we're parsing our collada file and buffering our graphics data. We're parsing at runtime in the demo, but in a real application you'd want to parse your collada files during a build step.

# Run the demo locally. Changes to the `demo` directory will live reload in your browser
# PRs and issues are welcome!
git clone https://github.com/chinedufn/collada-dae-parser && cd collada-dae-parser && npm install && npm run demo

CLI

Output stringified JSON to stdout

# parse from stdin
cat my-3d-model.dae | dae2json > parsed-model.json

# parse from file
dae2json my-3d-modal.dae > parsed-model.json

API

parseDae(xmlFile, callback) -> object

This function returns the parsed collada object.

xmlFile

Required

Type: string or Buffer

Your collada file data. Not the filename, the file contents.

callback

Optional

Type: function

function (err, parsedDaeObject) {
  console.log(parsedDaeObject)
  /*
  {
    keyframes: {...},
    vertexNormalIndices: [...],
    vertexNormals: [...],
    vertexPositionIndices: [...],
    vertexPositions: [...],
    vertexUVIndices: [...],
    vertexUVs: [...]
  }
  */
}

TODO:

  • src: basic cli (potentially pull into own repo, but start here)

  • src: Allow file buffer to be passed in

  • src: Factor in bind shape matrix

  • src: Stop exporting bind shape matrix

  • demo: fix normals in demo lighting

  • src / demo: add a textured demo model

  • src: rounding values. Currently lots of .999999 and 1.000001

  • src: All of the TODO: statements in code

  • demo: full screen demo with controls overlay

  • demo: toggle between 2 animations

  • demo: Support mobile touch events

  • demo: allow zoom in, zoom out in demo

  • doc: Add a GIF of every test fixture animation and demo

  • doc: Documentation

  • A separate package that uses collada-dae-parser to implement a stateless skeletal animation system

References

See Also

License

MIT

Keywords

FAQs

Package last updated on 26 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc