GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - MacDue/SimpleObjLoader: A very simple Wavefront .obj loader with glut support.

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
LICENSE
LICENSE
 
 
README.md
README.md
 
 
simple_obj.h
simple_obj.h
 
 

Repository files navigation

Simple Obj Loader

A really simple single header Wavefront .obj loader with glut support.

Including:

// Only needed at first include
#define SIMPLE_OBJ_IMP
// glut needs to be included first for drawObj implementation
#include <GL/glut.h>
#include "simple_obj.h"
Full docs:

Usage:

// Loading a .obj
SimpleObj_t* myObj = loadObj("some_model.obj");

Drawing:

// GL setup stuff, transforms, ect...
drawObj(myObj);
// More GL stuff

Groups:

// Access the struct for the first group in the file.
ObjGroup_t* group = objDataArrayAccess(&myObj->groups, 0);
// Attributes: name, startFace, endFace, & render.
group->render = false; // don't draw this group.

Freeing obj data:

// This obj is trash
disposeObj(myObj);
// It's where it belongs now

Working:

  • Vertices
  • Normals
  • Texture coords
  • Faces
  • Basic rendering

Todo:

  • Separate group rendering (done)
  • Materials
  • Maybe support some more obj features
  • Clean up and free stuff (done)
Example result:

alt text

About

A very simple Wavefront .obj loader with glut support.

Topics

ccomp27112glutopenglsingle-headersingle-header-libwavefront-obj

Resources

Readme
Unlicense
Activity

Stars

12 stars

Watchers

3 watching

Forks

3 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.