From: daid303 Date: Wed, 3 Apr 2013 14:01:20 +0000 (+0200) Subject: Fix shader code (caused exception on mac) X-Git-Tag: 13.05~132 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a4865510caf41f7c7e51d0f75ac2a9e6033794ad;p=cura.git Fix shader code (caused exception on mac) --- diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py index f29b5470..fbe94816 100644 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@ -341,7 +341,7 @@ void main(void) gl_FrontColor = gl_Color; light_amount = abs(dot(normalize(gl_NormalMatrix * gl_Normal), normalize(gl_LightSource[0].position.xyz))); - light_amount *= 1 - (length(gl_Position.xyz - vec3(0,0,cameraDistance)) / 1.5 / cameraDistance); + light_amount *= 1.0 - (length(gl_Position.xyz - vec3(0.0,0.0,cameraDistance)) / 1.5 / cameraDistance); light_amount += 0.2; } """,""" @@ -368,7 +368,7 @@ void main(void) gl_FrontColor = gl_Color; light_amount = abs(dot(normalize(gl_NormalMatrix * gl_Normal), normalize(gl_LightSource[0].position.xyz))); - light_amount *= 1 - (length(gl_Position.xyz - vec3(0,0,cameraDistance)) / 1.5 / cameraDistance); + light_amount *= 1.0 - (length(gl_Position.xyz - vec3(0.0,0.0,cameraDistance)) / 1.5 / cameraDistance); light_amount += 0.2; } """,""" diff --git a/Cura/util/objectScene.py b/Cura/util/objectScene.py index 1f0ffd3f..4ddfdddd 100644 --- a/Cura/util/objectScene.py +++ b/Cura/util/objectScene.py @@ -53,6 +53,10 @@ class Scene(): for obj in self._objectList: obj.setPosition(obj.getPosition() + offset) + def printOrder(self): + order = range(0, len(self._objectList)) + return order + def _pushFree(self): for a in self._objectList: for b in self._objectList: