Code Monkey home page Code Monkey logo

obj2gltf's Introduction

OBJ2GLTF

Convert OBJ assets to glTF 1.0.

Getting Started

Install Node.js if you don't already have it, and then:

npm install --save obj2gltf

Using obj2gltf as a library:

var obj2gltf = require('obj2gltf');
var convert = obj2gltf.convert;
var options = {
    embedImage : false // Don't embed image in the converted glTF
}
convert('model.obj', 'model.gltf', options)
    .then(function() {
        console.log('Converted model');
    });

Using obj2gltf as a command-line tool:

node bin/obj2gltf.js model.obj

node bin/obj2gltf.js model.obj model.gltf

node bin/obj2gltf.js -i model.obj -o model.gltf

node bin/obj2gltf.js -i model.obj -o model.gltf -s

Usage

###Command line flags:

Flag Description Required
-i Path to the input OBJ file. โœ… Yes
-o Directory or filename for the exported glTF file. No
-b Output binary glTF. No, default false
-s Writes out separate geometry/animation data files, shader files, and textures instead of embedding them in the glTF file. No, default false
-t Write out separate textures only. No, default false
--ao Apply ambient occlusion to the converted model. No, default false
-h Display help No

Contributions

Pull requests are appreciated. Please use the same Contributor License Agreement (CLA) used for Cesium.


Developed by the Cesium team.

obj2gltf's People

Contributors

lilleyse avatar pjcozzi avatar lasalvavida avatar analyticalgraphics avatar

Watchers

James Cloos avatar RandomName avatar

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.