From 9c9f35753489cba5a61816104ac294857be20941 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 29 Apr 2011 20:35:20 +0200 Subject: host/simu: transpose transformation matrix, reverse transformation order This is better because transformations can be built incrementally from the container to the contained. This use the same semantic as OpenGL. --- host/simu/robots/aquajim/model/sorter.py | 2 +- host/simu/robots/aquajim/view/robot.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'host/simu/robots/aquajim') diff --git a/host/simu/robots/aquajim/model/sorter.py b/host/simu/robots/aquajim/model/sorter.py index e7b69761..93ff5e2a 100644 --- a/host/simu/robots/aquajim/model/sorter.py +++ b/host/simu/robots/aquajim/model/sorter.py @@ -58,8 +58,8 @@ class Sorter (Observable): for i in self.into: if i.pos is None: return None - m.rotate (i.angle) m.translate (i.pos) + m.rotate (i.angle) return m.apply (pos) def __arm_motor_notified (self): diff --git a/host/simu/robots/aquajim/view/robot.py b/host/simu/robots/aquajim/view/robot.py index ad613bba..aefe2170 100644 --- a/host/simu/robots/aquajim/view/robot.py +++ b/host/simu/robots/aquajim/view/robot.py @@ -42,8 +42,8 @@ class Robot (simu.inter.drawable.Drawable): """Draw the robot.""" self.reset () if self.pos is not None: - self.trans_rotate (self.angle) self.trans_translate (self.pos) + self.trans_rotate (self.angle) # Draw robot body. self.draw_polygon ((150, 155), (-90, 155), (-150, 70), (-150, -70), (-90, -155), (150, -155)) -- cgit v1.2.3