Commit 76afe304 authored by sumpfralle's avatar sumpfralle

don't transform the edges of a triangle during a rotation/shifting - they are...

don't transform the edges of a triangle during a rotation/shifting - they are re-calculated afterwards anyway
 * this should improve the performance of model transformations significantly
fixed the order of the vertices for OpenGL: a counter-clockwise order is expected


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@711 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 9dfaa79b
...@@ -92,9 +92,6 @@ class Triangle(TransformableContainer): ...@@ -92,9 +92,6 @@ class Triangle(TransformableContainer):
yield self.p1 yield self.p1
yield self.p2 yield self.p2
yield self.p3 yield self.p3
yield self.e1
yield self.e2
yield self.e3
yield self.normal yield self.normal
def get_points(self): def get_points(self):
...@@ -111,9 +108,11 @@ class Triangle(TransformableContainer): ...@@ -111,9 +108,11 @@ class Triangle(TransformableContainer):
# use normals to improve lighting (contributed by imyrek) # use normals to improve lighting (contributed by imyrek)
normal_t = self.normal normal_t = self.normal
GL.glNormal3f(normal_t.x, normal_t.y, normal_t.z) GL.glNormal3f(normal_t.x, normal_t.y, normal_t.z)
# The triangle's points are in clockwise order, but GL expects
# counter-clockwise sorting.
GL.glVertex3f(self.p1.x, self.p1.y, self.p1.z) GL.glVertex3f(self.p1.x, self.p1.y, self.p1.z)
GL.glVertex3f(self.p2.x, self.p2.y, self.p2.z)
GL.glVertex3f(self.p3.x, self.p3.y, self.p3.z) GL.glVertex3f(self.p3.x, self.p3.y, self.p3.z)
GL.glVertex3f(self.p2.x, self.p2.y, self.p2.z)
GL.glEnd() GL.glEnd()
if False: # display surface normals if False: # display surface normals
n = self.normal n = self.normal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment