summaryrefslogtreecommitdiffhomepage
path: root/host/simu/robots/marcel/model/loader.py
diff options
context:
space:
mode:
authorNicolas Schodet2011-04-29 20:35:20 +0200
committerNicolas Schodet2011-04-29 20:35:20 +0200
commit9c9f35753489cba5a61816104ac294857be20941 (patch)
treeba36dbe8fda70ca491fc499128c6f317c532cbc7 /host/simu/robots/marcel/model/loader.py
parentde2a1e81eef5054725ae218afaf51dc8e06dedd0 (diff)
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.
Diffstat (limited to 'host/simu/robots/marcel/model/loader.py')
-rw-r--r--host/simu/robots/marcel/model/loader.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/host/simu/robots/marcel/model/loader.py b/host/simu/robots/marcel/model/loader.py
index 0270ce79..ae1caa7d 100644
--- a/host/simu/robots/marcel/model/loader.py
+++ b/host/simu/robots/marcel/model/loader.py
@@ -159,8 +159,8 @@ class Loader (Observable):
# If gate is high, drop elements.
if self.load and self.gate_angle > self.GATE_STROKE / 2:
m = TransMatrix ()
- m.rotate (self.robot_position.angle)
m.translate (self.robot_position.pos)
+ m.rotate (self.robot_position.angle)
pos = m.apply ((-250, 0))
for e in self.load:
e.pos = pos
@@ -177,9 +177,9 @@ class Loader (Observable):
return elements
# Matrix to transform an obstacle position into robot coordinates.
m = TransMatrix ()
+ m.rotate (-self.robot_position.angle)
m.translate ((-self.robot_position.pos[0],
-self.robot_position.pos[1]))
- m.rotate (-self.robot_position.angle)
# Look up elements.
# This could be used if clamp blocking is handled or elements are
# pushed: