Skip to content

Object file loading

This example shows how to load a 3D object from a wavefront .obj file using PHP OpenGL. It displays how to utilize the \GL\Geometry\ObjFileParser class to load a 3D object from a file and how to render it.

Loading a .obj file in PHP

Loading a .obj file in PHP

Run this example:

php examples/05_objloading.php
--------------------------------------------------------------------------------
-> Press ESC to close the window
-> Press W to toggle wireframe mode
--------------------------------------------------------------------------------