Skip to content

ssh4net/OBJ2BIN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OBJ2BIN

Small command line helper tool for GpuPAD (https://github.com/houmain/gpupad) that parses 3D mesh from OBJ file. Serializing the data: create a unique vertices array - each unique combination of position, UV, and normal indices in the .obj file defines a unique vertex (as for OpenGL). Construct an index buffer that can be used directly with these unique vertices. The result is written per attribute in the binary files: Index (uint32), Vertices/Normals/UVs float.

Tools use rapidobj https://github.com/guybrush77/rapidobj

Usage

OBJ2BIN.exe path_to/file.obj [ascii]

The output will be written in the same folder:

file_idxs.bin
file_norm.bin
file_uv.bin
file_vert.bin

Using ascii option arrays, they would be written in ascii mode (for debugging).

Limitations

  • Only vertex, normals, and texture coordinates are supported
  • Only the first object is exporting
  • In case of no texture coordinates or no vertex normals, the app might crash (TODO: fix this)

License

It is released under the GNU GPLv3. Please see LICENSE for license details.

About

Convert OBJ 3D mesh to the per attribute arrays

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages