Skip to content

StefanJohnsen/Wavefront98

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wavefront98

Wavefront OBJ and MTL parser C++ 98

Compatibility and Dependencies

  • C++ 98 Standard
  • Standard Template Library (STL)

This project is designed to be compatible with C++98 and utilizes solely C++ Standard Template Library (STL) components. It has been thoughtfully engineered to function independently without the need for any external libraries or dependencies. This design ensures the project remains self-contained, promoting simplicity and ease of integration into your development environment.

*If you require the use of C++11 or newer, see WavefrontOBJ and WavefrontMTL repository.

OS Support

  • Windows
  • Linux
  • macOS

Speed and memory

  • By supporting C++ 98 Standard only and without use of multithreading, we have achieved a good level of speed.
  • This solution boasts minimal memory usage, typically averaging twice the file size in memory consumption.

Usage

Copy WavefrontOBJ.h, WavefrontMTL.h and WavefrontMTL.cpp to your project and include the file.

#include "WavefrontOBJ.h"
#include "WavefrontMTL.h"

Parsed examples

Wavefront98 have been integrated into the Polyscope 3D viewer, showcasing the parsing capabilities.

Polyscope 3D model Mars Perseverance Rover, from NASA's Jet Propulsion Laboratory

Description

This repository is a faithful replica of WavefrontOBJ and WavefrontMTL, meticulously maintained for your convenience. The comprehensive documentation and resources from those repositories remain unchanged. The only distinction lies in the programming language used – this codebase is crafted with C++98, while the original repositories are based on C++11.

Please refer to the corresponding repositories linked above for all the information you require. Whether you're interested in the capabilities of WavefrontOBJ or the utilities of WavefrontMTL, you'll find everything you need to know.

Benchmark C++98

The benchmark was conducted on a computer with the following specifications:

  • Processor: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz 2.59 GHz
  • Memory: 16.0 GB
  • Operating System: 64-bit operating system, x64-based processor
  • Compiler: Visual Studio Version 2022 (v143, C++ 14 Standard)
  • Release Mode: Visual Studio release mode was used for benchmarking.
File Name File Size (KB) Load time (Milliseconds) Memory Usage
rungholt 269 215 1370 594MB
powerplant 798 723 3788 1.6GB
san-miguel 1 116 252 5152 2.1GB

Time was evaluated through 10 iterative runs, calculating the average execution time.
Memory usage was analyzed using Visual Studio 2022 C++17 Diagnostic Tools in Release mode.
See section Benchmark code in WavefrontOBJ

The files above are sourced from Morgan McGuire, Computer Graphics Archive, July 2017.

The benchmark results vary based on the computer's hardware and software configuration.

References

The following sources have been utilized in developing Wavefront98.

Paul Bourke: Object Files (OBJ)

Paul Bourke: MTL material format (Lightwave, OBJ)

Wikipedia: Wavefront .obj file

FileFormat.info: WaveFront Material (.mtl) File Format

License

This software is released under the GNU General Public License v3.0 terms.
Details and terms of this license can be found at: https://www.gnu.org/licenses/gpl-3.0.html

For those who require the freedom to operate without the constraints of the GPL,
a commercial license can be obtained by contacting the author at stefan.johnsen@outlook.com