Open GoogleCodeExporter opened 8 years ago
Same happens with a scaled do3d and pitch/yaw/roll
Original comment by p...@paultondeur.nl
on 14 Apr 2009 at 9:23
Seems to happen when Quaternion.setFromAxisAngle is fed an axis which isn't
normalized. This patch seems to work:
public function setFromAxisAngle( x:Number, y:Number, z:Number, angle:Number
):void
{
// axis normalization
var n:Number = Math.sqrt(x*x+y*y+z*z);
x /= n;
y /= n;
z /= n;
// original code
var sin:Number = Math.sin( angle / 2 );
var cos:Number = Math.cos( angle / 2 );
this.x = x * sin;
this.y = y * sin;
this.z = z * sin;
this.w = cos;
this.normalize();
}
BUT - I have no idea if this mathematically correct, if it breaks any other
parts of
Papervision and whether the this.normalize() call at the end is still
necessary. Use
at your own risk.
Original comment by Yonatan....@gmail.com
on 16 Apr 2009 at 1:02
btw, i'm pretty sure this is a duplicate of issue 115.
Original comment by Yonatan....@gmail.com
on 16 Apr 2009 at 1:13
You're right, this is a duplication issue 115. Excuses for this duplicated bug
report.
Original comment by p...@paultondeur.nl
on 18 Apr 2009 at 3:16
I tried the patch Yonatan offered (Thank you!), and while it is close, I find
that
error accumulates as scale is changed and localRotations occur. Eventually it
gets
to the point where the error is visually noticeable. Has anyone found a working
modificiation?
Original comment by mgre...@gmail.com
on 5 Feb 2010 at 7:51
Maybe related: I'd scaled an imported collada file down to 1% of its original
size
and was rotating it forwards on the x axis using localRotationX, yet it was
turning
backwards very slowly when viewed from a seperate vantage point (Another
client, this
is a multiplayer project). I replaced it with a Max3DS model which I don't need
to
scale (due to the size import difference) and the rotation is correct.
Original comment by garypa...@gmail.com
on 28 Apr 2010 at 9:44
Original issue reported on code.google.com by
p...@paultondeur.nl
on 14 Apr 2009 at 9:19