Commit a87a94d4 authored by Whitham D. Reeve II's avatar Whitham D. Reeve II

Remove old commented out code.

parent d46107ec
......@@ -148,26 +148,21 @@ class OpenGLViewModelTriangle(pycam.Plugins.PluginBase):
suitable = (0, 0, 0, 'v')
for normal, weight in normals:
dot = pdot(main, normal)
#dot = main.dot(normal)
if dot > 0:
suitable = padd(suitable, pmul(normal, weight * dot))
#suitable = suitable.add(normal.mul(weight * dot))
return pnormalized(suitable)
#return suitable.normalized()
vertices = {}
for t in model.triangles():
for p in (t.p1, t.p2, t.p3):
if not p in vertices:
vertices[p] = []
vertices[p].append((pnormalized(t.normal), t.get_area()))
#vertices[p].append((t.normal.normalized(), t.get_area()))
GL.glBegin(GL.GL_TRIANGLES)
for t in model.triangles():
# The triangle's points are in clockwise order, but GL expects
# counter-clockwise sorting.
for p in (t.p1, t.p3, t.p2):
normal = calc_normal(pnormalized(t.normal), vertices[p])
#normal = calc_normal(t.normal.normalized(), vertices[coords])
GL.glNormal3f(normal[0], normal[1], normal[2])
GL.glVertex3f(p[0], p[1], p[2])
GL.glEnd()
......
......@@ -816,11 +816,9 @@ class Camera(object):
return
max_dim = max([high - low for low, high in low_high])
distv = pnormalized((v["distance"][0], v["distance"][1], v["distance"][2]))
#distv = Point(v["distance"][0], v["distance"][1],v["distance"][2]).normalized()
# The multiplier "1.25" is based on experiments. 1.414 (sqrt(2)) should
# be roughly sufficient for showing the diagonal of any model.
distv = pmul(distv, (max_dim * 1.25) / number(math.sin(v["fovy"] / 2)))
#distv = distv.mul((max_dim * 1.25) / number(math.sin(v["fovy"] / 2)))
self.view["distance"] = distv
# Adjust the "far" distance for the camera to make sure, that huge
# models (e.g. x=1000) are still visible.
......@@ -979,8 +977,6 @@ class Camera(object):
distv = self.view["distance"]
distv = pnormalized((distv[0], distv[1], distv[2]))
factors_x = pnormalized(pcross(distv, (v_up[0], v_up[1], v_up[2])))
#factors_x = distv.cross(Point(v_up[0], v_up[1], v_up[2])).normalized()
#factors_x = (factors_x.x, factors_x.y, factors_x.z)
return (factors_x, factors_y)
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