Esempio n. 1
0
	def activated(self):
		f1 = self.amplitude * (math.cos(self.angle) + 1.0)
		f2 = 1.0 - 2.0 * f1
		
		opengl.glMatrixMode(opengl.GL_TEXTURE)
		opengl.glLoadIdentity() # Needed, because activated() may be called several time without inactivated being called
		opengl.glTranslatef(f1, f1, 0.0)
		opengl.glScalef(f2, f2, 1.0)
		opengl.glMatrixMode(opengl.GL_MODELVIEW)
Esempio n. 2
0
	def inactivated(self):
		opengl.glMatrixMode(opengl.GL_TEXTURE)
		opengl.glLoadIdentity()
		opengl.glMatrixMode(opengl.GL_MODELVIEW)
Esempio n. 3
0
	def activated(self):
		opengl.glMatrixMode(opengl.GL_TEXTURE)
		opengl.glLoadIdentity() # Needed, because activated() may be called several time without inactivated being called
		opengl.glTranslatef(self.amplitude * math.cos(self._angle), self.amplitude * math.sin(self._angle), 0.0)
		opengl.glMatrixMode(opengl.GL_MODELVIEW)
Esempio n. 4
0
	def activated(self):
		opengl.glMatrixMode(opengl.GL_TEXTURE)
		opengl.glLoadIdentity() # Needed, because activated() may be called several time without inactivated being called
		opengl.glTranslatef(self._tex_x, self._tex_y, 0.0)
		opengl.glMatrixMode(opengl.GL_MODELVIEW)