/pygame-show-obj

use pygame to show 3D obj model

Primary LanguagePython

Introduction

This a sample example for shwoing 3D obj with pygame, pyopengl. If you are familar with c++, trimesh2 is a better way to show 3D obj. But this python code is simple and convient.

CSDN博客介绍

Requirements

pip install pygame
pip install  PyOpenGL PyOpenGL_accelerate

Demo

1.test_obj.py

1.test-res

You can use mouse to move, rotate and scale it. And you may set lighting for a better viewing. You need to be familiar with opengl.

(鼠标移动,自行设置光照,具体可以看代码)

See the code to learn more. (eg. I use pickle to accelerate loading)

2.test_mtl.py

2.test-res 2.test-res

References

OBJFileLoader BXT-AR-For-Python