https://github.com/udhos/gwob
gwob - Pure Go Golang parser for Wavefront .OBJ 3D geometry file format
https://github.com/udhos/gwob
geometry go golang graphics mesh obj opengl wavefront-obj
Last synced: 8 months ago
JSON representation
gwob - Pure Go Golang parser for Wavefront .OBJ 3D geometry file format
- Host: GitHub
- URL: https://github.com/udhos/gwob
- Owner: udhos
- License: mit
- Created: 2016-08-16T20:26:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-05-04T22:00:53.000Z (over 1 year ago)
- Last Synced: 2025-03-31T16:14:00.402Z (10 months ago)
- Topics: geometry, go, golang, graphics, mesh, obj, opengl, wavefront-obj
- Language: Go
- Size: 62.5 KB
- Stars: 37
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/udhos/gwob/blob/master/LICENSE)
[](http://godoc.org/github.com/udhos/gwob)
[](https://goreportcard.com/report/github.com/udhos/gwob)
# gwob
gwob - Pure Go Golang parser for Wavefront .OBJ 3D geometry file format
# Install
## Install with Go Modules (Go 1.11 or higher)
git clone https://github.com/udhos/gwob
cd gwob
go install
## Install without Go Modules (Go before 1.11)
go get github.com/udhos/gwob
cd ~/go/src/github.com/udhos/gwob
go install github.com/udhos/gwob
# Usage
Import the package in your Go program:
import "github.com/udhos/gwob"
Example:
// Error handling omitted for simplicity.
import "github.com/udhos/gwob"
options := &gwob.ObjParserOptions{} // parser options
o, errObj := gwob.NewObjFromFile("gopher.obj", options) // parse/load OBJ
// Scan OBJ groups
for _, g := range o.Groups {
// ...
}
# Example
Run the example:
cd example
go run main.go
You can supply a custom input OBJ by setting the env var INPUT:
INPUT=gopher.obj go run main.go
If you specify any command line argument, the OBJ will be dumped to stdout:
go run main.go d
See directory [example](example).
# Documentation
See the [GoDoc](http://godoc.org/github.com/udhos/gwob) documentation.