Coder Social home page Coder Social logo

zeta0134 / dsgx-converter Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 215 KB

Converts 3D graphics objects (currently .obj only) directly into NDS graphics commands, to be used with glCalllist() directly. Emphasis on accuracy > speed > memory usage.

Python 100.00%

dsgx-converter's People

Contributors

cromo avatar zeta0134 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

dsgx-converter's Issues

Implement vertex-based animation, as an option

Especially for small objects, vertex-based animation is more efficient both in terms of data storage for the points and in terms of processing power on the NDS. Dealing with bones is expensive for all the matrix calculations, and if the bone only affects a tiny number of vertices, it really isn't worth it.

This will require some way to indicate in the DSGX file which set of data we're working with, but in practice it'll work similar to bone-based animation. Each vertex will have a list of offsets (where that point is used in the DSGX list) and then one copy of the data per frame of each animation. We'll need to update vertex and normal data per frame, but everything else can stay static, so there's no real need to re-bake the whole DSGX file for each chunk.

Migrate away from euclid library

As written, the euclid library for working with vectors and matrix structures is outdated, hasn't been updated since 2011, and seems to be packaged strangely, which complicates its use in deterministic builds. We should research a more appropriate library.

Emix MTX_4x3 and MTX_3x3 where appropriate

Avoiding emitting MTX_4x4 commands where possible will shave off cycles for matrix operations; this becomes significant with any animated object, as there are lots of matrix operations to handle the bones.

Does not handle multiple meshes

When multiple meshes are used within a single file, the exporter fails to account for the offsets of each mesh and causes wrapping of points when viewed on the DS.

Implement triangle / quad strip detection and emitting

This will greatly reduce the file size and cycle count where possible, should speed up rendering a bit (less point data to process per model) and should help to reduce the workload done applying animations.

General strategy: build up an adjacency graph based on polygons who share an edge, then repeatedly traverse this graph searching for the longest strip. Lather rinse repeat until there are no more strips, then emit everything else as separate polygons. (Handle quads and triangles separately.) Should be striaghtforward enough.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.