google-code-export / visvis

Automatically exported from code.google.com/p/visvis
Other
1 stars 1 forks source link

Error in orientation.py for flipped direction #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
IS: lines 132 - 145
            if axis.norm() < 0.1:
                if self._direction.z > 0:
                    # No rotation
                    self._directionTransform.ax = 0.0
                    self._directionTransform.ay = 0.0
                    self._directionTransform.az = 1.0
                    self._directionTransform.angle = 0.0
                else:
                    # Flipped
                    self._directionTransform.ax = 1.0
                    self._directionTransform.ay = 0.0
                    self._directionTransform.az = 0.0
                    self._directionTransform.angle = np.pi
            else:

PROPOSED FIX:

            if axis.norm() < 0.01:  #gives better control over reorientation and seems to work
                if self._direction.z > 0:
                    # No rotation
                    self._directionTransform.ax = 0.0
                    self._directionTransform.ay = 0.0
                    self._directionTransform.az = 1.0
                    self._directionTransform.angle = 0.0
                else:
                    # Flipped
                    self._directionTransform.ax = 1.0
                    self._directionTransform.ay = 0.0
                    self._directionTransform.az = 0.0
                    self._directionTransform.angle = 180.0 #Value is in degrees elsewhere, radians give wrong result
            else:

Original issue reported on code.google.com by geith.gm...@gmail.com on 8 May 2012 at 6:43

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 9c34ef567624.

Original comment by almar.klein@gmail.com on 10 May 2012 at 10:08