chiark / gitweb /
Fix shader code (caused exception on mac)
authordaid303 <daid303@gmail.com>
Wed, 3 Apr 2013 14:01:20 +0000 (16:01 +0200)
committerdaid303 <daid303@gmail.com>
Wed, 3 Apr 2013 14:01:20 +0000 (16:01 +0200)
Cura/gui/sceneView.py
Cura/util/objectScene.py

index f29b5470a00a80cd434852917e005d2bb16e196f..fbe948167a0f3150a5ecae41269fdfd86fd3bb83 100644 (file)
@@ -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;
 }
                        ""","""
index 1f0ffd3ff4fffe29b6733ddf2e47cac8a4fa1024..4ddfdddde755dd7300c19c6a61dd2c637967bbbb 100644 (file)
@@ -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: