Hot answers tagged

2

NOTE: Edited because it was likely too verbose (source). A rotation matrix actually always defines an orthonormal basis. What this means is each column defines one of your original axes in its rotated state. For example, consider a simple rotation matrix around the z-axis (more on rotation matrices here). Let's say we plug in Pi / 2, in other words, we ...


1

So I guess you could save like the last 10 rotations in a List and get the average of them with this function. The function return could be set as your final rotation. This should smoothen your rotation. private Quaternion calcAvg(List<GameObject> rotationlist) { if (rotationlist.Count == 0) throw new ArgumentException(); float x, y, ...


1

Ok, after 4 hours of searching finally I found the mistake. Problem was with the sprite origin. Here's the line that was necessary (staticBody is the body around other bodies will rotate) tmpSprite.setOrigin(staticBody.getPosition().x / 32 + tmpSprite.getWidth() / 2, staticBody.getPosition().y / 32 + tmpSprite.getHeight() / 2); And here's ...


1

You could rebuild the spears orientation matrix from a direction vector. Good example with dx code is here.. http://stackoverflow.com/questions/4237873/rotate-a-sphere-so-that-its-pole-heads-towards-the-camera/4237921#4237921



Only top voted, non community-wiki answers of a minimum length are eligible