From c5591f3d2d23711b21e8170d9b79c7c2a4f13abd Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Fri, 25 Nov 2016 11:39:34 +0100 Subject: [PATCH] Fixed packages --- convert.py | 4 ++-- {controls => d3}/__init__.py | 0 {conv3d => d3/controls}/__init__.py | 0 controls/Controls.py => d3/controls/controls.py | 12 +++++++++++- d3/conv/__init__.py | 0 {conv3d => d3/conv}/loadmodel.py | 0 {conv3d => d3/conv}/model.py | 0 {conv3d => d3/conv}/obj.py | 0 {conv3d => d3/conv}/ply.py | 0 modelviewer.py | 8 +++----- 10 files changed, 16 insertions(+), 8 deletions(-) rename {controls => d3}/__init__.py (100%) rename {conv3d => d3/controls}/__init__.py (100%) rename controls/Controls.py => d3/controls/controls.py (87%) create mode 100644 d3/conv/__init__.py rename {conv3d => d3/conv}/loadmodel.py (100%) rename {conv3d => d3/conv}/model.py (100%) rename {conv3d => d3/conv}/obj.py (100%) rename {conv3d => d3/conv}/ply.py (100%) diff --git a/convert.py b/convert.py index e5da46d..4df00af 100755 --- a/convert.py +++ b/convert.py @@ -3,8 +3,8 @@ import argparse import os -from conv3d.ply import PLYExporter -from conv3d.loadmodel import convert +from d3.conv.ply import PLYExporter +from d3.conv.loadmodel import convert from functools import partial def check_path(path, should_exist): diff --git a/controls/__init__.py b/d3/__init__.py similarity index 100% rename from controls/__init__.py rename to d3/__init__.py diff --git a/conv3d/__init__.py b/d3/controls/__init__.py similarity index 100% rename from conv3d/__init__.py rename to d3/controls/__init__.py diff --git a/controls/Controls.py b/d3/controls/controls.py similarity index 87% rename from controls/Controls.py rename to d3/controls/controls.py index 92242c9..70aeab1 100644 --- a/controls/Controls.py +++ b/d3/controls/controls.py @@ -1,5 +1,15 @@ #!/usr/bin/env python3 +from ..conv.model import Vertex + +import pygame + +from OpenGL.GL import * +from OpenGL.GLU import * +from OpenGL.GLUT import * + +import math + class Controls: def __init__(self): pass @@ -12,7 +22,7 @@ class Controls: class TrackBallControls(Controls): def __init__(self): - super().__init__(self) + super().__init__() self.vertex = Vertex() self.theta = 0 diff --git a/d3/conv/__init__.py b/d3/conv/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/conv3d/loadmodel.py b/d3/conv/loadmodel.py similarity index 100% rename from conv3d/loadmodel.py rename to d3/conv/loadmodel.py diff --git a/conv3d/model.py b/d3/conv/model.py similarity index 100% rename from conv3d/model.py rename to d3/conv/model.py diff --git a/conv3d/obj.py b/d3/conv/obj.py similarity index 100% rename from conv3d/obj.py rename to d3/conv/obj.py diff --git a/conv3d/ply.py b/d3/conv/ply.py similarity index 100% rename from conv3d/ply.py rename to d3/conv/ply.py diff --git a/modelviewer.py b/modelviewer.py index 0781046..5f3357f 100755 --- a/modelviewer.py +++ b/modelviewer.py @@ -13,10 +13,9 @@ from OpenGL.GL.shaders import * from OpenGL.GLU import * from OpenGL.GLUT import * -from conv3d.loadmodel import load_model -from conv3d.model import Vertex - -from controls import TrackBallControls +from d3.conv.loadmodel import load_model +from d3.conv.model import Vertex +from d3.controls.controls import TrackBallControls WINDOW_WIDTH = 1024 WINDOW_HEIGHT = 768 @@ -67,7 +66,6 @@ def main(args): with open('shaders/shader.frag') as f: FRAGMENT_SHADER = compileShader(f.read(), GL_FRAGMENT_SHADER) - print(VERTEX_SHADER, FRAGMENT_SHADER) SHADER = compileProgram(VERTEX_SHADER, FRAGMENT_SHADER) while running: