pygame-show-obj
pygame-show-obj copied to clipboard
use pygame to show 3D obj model
Introduction
This a simple example about 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.
Requirements
pip install pygame
pip install PyOpenGL PyOpenGL_accelerate
Demo
1.test_obj.py
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