Trying to figure out why we have a mystery island that inconsistently reports itself as being in whatever province you were last in before you reached it.
Can someone explain to me the difference between an axis and a local axis? I found this wording when looking into a library implementing quaternion transformations
When composing rotations, it can mean that we're applying the new rotation "under/before" the old rotation, rather than "over/after"
Take an object that's already been rotated to some arbitrary orientation. If I say "Apply a change to the rotation of +x degrees around the X axis" I could mean one of two things....
Find the direction the world X axis is pointing, and rotate the object around that...
Or, find the direction the object's X axis is pointing, according to its current rotation, and rotate it around that. This latter style would be a "local" axis rotation.
alas i would question if there's any point in having a method that turns around the 'worldaxis' instead of making it a method turning about an arbitrary axis/vector instead
when i have relative rotations based on parent objects and such, I'll need to rotate around their axis anyway (not to forget offset between their center of rotation and the pos of my child)
Try rotating each basis vector (1, 0, 0), (0, 1, 0), (0, 0, 1) by the quaternion. Now you have the columns (or rows, depending on your multiplication convention) of your rotation matrix.
The formula will just be that process, with any repeated/redundant sub-expressions eliminated.
Here's how it's done in the Unity C# reference, for example:
// Creates a rotation matrix. Note: Assumes unit quaternion
public static Matrix4x4 Rotate(Quaternion q)
{
// Precalculate coordinate products
float x = q.x * 2.0F;
float y = q.y * 2.0F;
float z = q.z * 2.0F;
float xx = q.x * x;
float yy = q.y * y;
float zz = q.z * z;
float xy = q.x * y;
float xz = q.x * z;
Its actually about the game play and collision. My avatar Can't detect collision and game crashes when ever that happens. Would have sent you a link to the game but that's not available at the moment
At least when starting out, you'd typically do your collision detection CPU-side, and not involve the GPU. So a graphics API like DirectX wouldn't be part of the equation.
Unless you're doing something a little exotic here?
How are you trying to perform collision detection in your game so far?
So let's say its not really related to d-x but I tried tracking my collision using RECT but it seems ok .still can't find out what's wrong maybe I'm just missing something
You said your game crashes. Do you get an exception, error message, or stack trace? Those are good places to start in diagnosing the source of a problem.
Remember that we know nothing about your situation except what you tell us here, so always err on the side of sharing too many details, rather than too few.