# Ronan085

Member Since 24 Apr 2013
Offline Last Active Jun 21 2014 09:29 AM

### In Topic: How to create a constant buffer with custom data structures

14 December 2013 - 05:23 PM

thanks @MJP all i had to do was bump sizeof(cbPerObject) up to the next multiple of 16 like you said

### In Topic: How do i implement linear interpolation

14 May 2013 - 11:43 AM

Some googling for "matrix to quaternion conversion" turned up http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/ which goes through the math and presents Java and C++ code for building a quaternion from a rotation matrix. Similar googling can be performed for "quaternion slerp" and "quaternion to matrix conversion".

really nice article thanks, thankfully XNAMath has a nice function XMQuaternionSlerp() so that will save me a ton of work;

Ok so where do i get this rotation information if the only transformation information i have is stored in one matrix

The 4x4 matrix of an affine transformation is compose of a 3x3 matrix that represents a linear mapping (in the case of posture data this is a rotation) and a translation vector (a column to the right of the 3x3 matrix or a row below it, depending on whether you are using column vectors or row vectors). The other four components are always "0 0 0 1".

Extract the rotation and the translation separately and convert the rotation to a quaternion (see JTippetts's post above).

thanks i was very clueless about how the different information was sorted in the matrix, any idea where the scaling information is

### In Topic: How do i implement linear interpolation

14 May 2013 - 06:39 AM

@Squared'D ya ive been using that equation but the result are not what im expecting, my file file format has specified that all transformation interpolation should be linear

rotating around something is not linear, since a rotation imply's movement in an arc around a point, rather than a straight line. doing slerp(sperhical linear interpolation) isn't easy with matrixs, quaternions simplify the mathematics(but are a bit hard to understand if you don't know complex numbers(still it can be a bit difficult to comprehend even then imo))

How are you representing the transformation that brings you from the frame of reference of the parent bone to the frame of reference of this bone? You probably want to use quaternions for the rotation part, and then use slerp or nlerp.

Ok so where do i get this rotation information if the only transformation information i have is stored in one matrix

### In Topic: How do i implement linear interpolation

13 May 2013 - 12:28 PM

@Álvaro The file format im using is based off collada so the transformations are represented by 4x4 matrixs

@Squared'D ya ive been using that equation but the result are not what im expecting, my file file format has specified that all transformation interpolation should be linear

### In Topic: Should i playback animations by time past or by frames past

08 May 2013 - 09:24 AM

Thanks