Giter Club home page Giter Club logo

wavedash's Introduction

Wavedash 🌊 ⏩

Basic Wavefront Object file parsing in lua, made with ❤️ with LÖVE2D in mind.

local wavedash = require "wavedash"

-- Parse your object!
teapot = wavedash.object.parse("teapot.obj")

Documentation

Documentation can be found online here, or can be generated locally via LDoc by running ldoc -c docs/config.ld -o index .

Supported Data & Attributes

The goal of this project is not to be a completely comprehensive .obj file loader/parser, but to provide accessor functions to facilitate loading of the vertex/polygon/line data within an .obj file.

More explicitly, the following data will be prioritized:

Data .obj file shorthand Supported Format Description
Geometric Vertex v v x y z [w] The x, y, and z components of the vertex, and an optional w component (the weight), assumed to be 1.0 if not provided
Vertex Texture vt vt u [v w] A horizontal texture direction u, an optional vertical texture direction v (default of 0), and an optional depth w (default of 0)
Vertex Normal vn vn i j k A normal vector with components i, j, and k
Face Elements f f v1[/[vt1][/vn1]] v2[/[vt2][/vn2]] v3[/[vt3][/vn3]] ... A face constructed from vertices of index v1, v2, ..., with optional texture indices vt1, vt2, ...``, and optional normal indices vn1, vn2, ...`

Notably lacking (for now) are line elements (l v1 v2 v3 v4 ...), parameter space vertices (vp u [w] [v]), or any material support (.mtl files). While these may be in the scope for future work on this project, in beginning iterations, these data points will be ignored.

License

This project is Copyright (C) 2019 Zach Hart, and Licensed under the GPLv3. The full text of this license can be found in LICENSE at the root of this project

wavedash's People

Contributors

zthart avatar

Watchers

James Cloos avatar  avatar

wavedash's Issues

Face iteration is clunky

Returning a 3-tuple out of the object.faces() iterator isn't ideal, and almost invalidates the purpose of having the face module - we can expose some functions in face that would make it simpler to iterate over them and get the data we care about.

Face module structure is lacking

Hanging the 3 index sets off the faces table isn't really providing much functionality outside of giving the outer table a name. This could be better.

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.