$ pip install -e git://github.com/Lait-au-Cafe/py3dviewer.git@master#egg=py3dviewer
A minimum code to display a simple square plane is like below.
import py3dviewer
model_vertices = [
10, 10, 0.,
-10, 10, 0.,
10, -10, 0.,
-10, -10, 0.]
model_indices = [
0, 1, 2,
3, 2, 1]
model_uvmap = [
1.0, 1.0,
0.0, 1.0,
1.0, 0.0,
0.0, 0.0]
viewer = py3dviewer.Viewer(
"Test Simple", # The name of window
model_vertices, # The vertex buffer of model
model_indices, # The index buffer of model
model_uvmap, # The uv map of model
"img/invader.png") # The path to the texture file
while True:
if not viewer.update():
print("Exit. ")
break