Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Convert OBJ assets to glTF

License

NotificationsYou must be signed in to change notification settings

likangning93/OBJ2GLTF

 
 

Repository files navigation

Convert OBJ assets toglTF 1.0.

Getting Started

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

npm install --save obj2gltf

Using obj2gltf as a library:

varobj2gltf=require('obj2gltf');varconvert=obj2gltf.convert;varoptions={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:

FlagDescriptionRequired
-iPath to the input OBJ file.✅ Yes
-oDirectory or filename for the exported glTF file.No
-bOutput binary glTF.No, defaultfalse
-sWrites out separate geometry/animation data files, shader files, and textures instead of embedding them in the glTF file.No, defaultfalse
-tWrite out separate textures only.No, defaultfalse
--aoApply ambient occlusion to the converted model.No, defaultfalse
-hDisplay helpNo

Build Instructions

Run the tests:

npm run test

To run JSHint on the entire codebase, run:

npm run jsHint

To run JSHint automatically when a file is saved, run the following and leave it open in a console window:

npm run jsHint-watch

Running Test Coverage

Coverage usesistanbul. Run:

npm run coverage

For complete coverage details, opencoverage/lcov-report/index.html.

The tests and coverage covers the Node.js module; it does not cover the command-line interface, which is tiny.

Generating Documentation

To generate the documentation:

npm run jsdoc

The documentation will be placed in thedoc folder.

Debugging

  • To debug the tests in Webstorm, open the Gulp tab, right click thetest task, and clickDebug 'test'.
  • To run a single test, change the test function fromit tofit.

Contributions

Pull requests are appreciated. Please use the sameContributor License Agreement (CLA) used forCesium.


Developed by the Cesium team.

About

Convert OBJ assets to glTF

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript100.0%

[8]ページ先頭

©2009-2025 Movatter.jp