chiark / gitweb /
Added proper Ultimaker2 platform text.
authordaid <daid303@gmail.com>
Fri, 20 Sep 2013 06:06:59 +0000 (08:06 +0200)
committerdaid <daid303@gmail.com>
Fri, 20 Sep 2013 06:06:59 +0000 (08:06 +0200)
Cura/gui/sceneView.py
Cura/resources/images/Ultimaker2backplate.png [new file with mode: 0644]
Cura/resources/meshes/ultimaker2_platform.stl

index 25dcffe9e8fb91598104b3a7d8b27a7eb17af029..5380bb9f937b64f1446bbd8a285d7ea4ebf8e689 100644 (file)
@@ -1170,7 +1170,7 @@ void main(void)
                                        self._platformMesh[machine] = meshes[0]
                                else:
                                        self._platformMesh[machine] = None
-                               if profile.getMachineSetting('machine_type') == 'ultimaker2':
+                               if machine == 'ultimaker2':
                                        self._platformMesh[machine]._drawOffset = numpy.array([0,-37,145], numpy.float32)
                                else:
                                        self._platformMesh[machine]._drawOffset = numpy.array([0,0,2.5], numpy.float32)
@@ -1178,6 +1178,44 @@ void main(void)
                        self._objectShader.bind()
                        self._renderObject(self._platformMesh[machine], False, False)
                        self._objectShader.unbind()
+
+                       #For the Ultimaker 2 render the texture on the back plate to show the Ultimaker2 text.
+                       if machine == 'ultimaker2':
+                               if not hasattr(self._platformMesh[machine], 'texture'):
+                                       self._platformMesh[machine].texture = opengl.loadGLTexture('Ultimaker2backplate.png')
+                               glBindTexture(GL_TEXTURE_2D, self._platformMesh[machine].texture)
+                               glEnable(GL_TEXTURE_2D)
+                               glPushMatrix()
+                               glColor4f(1,1,1,1)
+
+                               glTranslate(0,150,-5)
+                               h = 50
+                               d = 8
+                               w = 100
+                               glEnable(GL_BLEND)
+                               glBlendFunc(GL_DST_COLOR, GL_ZERO)
+                               glBegin(GL_QUADS)
+                               glTexCoord2f(1, 0)
+                               glVertex3f( w, 0, h)
+                               glTexCoord2f(0, 0)
+                               glVertex3f(-w, 0, h)
+                               glTexCoord2f(0, 1)
+                               glVertex3f(-w, 0, 0)
+                               glTexCoord2f(1, 1)
+                               glVertex3f( w, 0, 0)
+
+                               glTexCoord2f(1, 0)
+                               glVertex3f(-w, d, h)
+                               glTexCoord2f(0, 0)
+                               glVertex3f( w, d, h)
+                               glTexCoord2f(0, 1)
+                               glVertex3f( w, d, 0)
+                               glTexCoord2f(1, 1)
+                               glVertex3f(-w, d, 0)
+                               glEnd()
+                               glDisable(GL_TEXTURE_2D)
+                               glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
+                               glPopMatrix()
                else:
                        glColor4f(0,0,0,1)
                        glLineWidth(3)
diff --git a/Cura/resources/images/Ultimaker2backplate.png b/Cura/resources/images/Ultimaker2backplate.png
new file mode 100644 (file)
index 0000000..9b663bf
Binary files /dev/null and b/Cura/resources/images/Ultimaker2backplate.png differ
index 9c76445085e79a6f20c11f362178689bb2b6c9cd..5a1bb14001ab6ddb0610165292f2c6fc6e65165b 100644 (file)
Binary files a/Cura/resources/meshes/ultimaker2_platform.stl and b/Cura/resources/meshes/ultimaker2_platform.stl differ