When you multiply two quaternions you are composing the two transformations together. The resulting rotation is the rotation obtained by first rotating according to rightmost quaternion and then according to the leftmost one. In your case, your first rotation maps (0, 1, 0) to mFrontWheelNormal and you then rotate around the normal vector by the angle Source.rotation.eulerAngles.y.
 Home
 » Viewing Profile: Reputation: apatriarca
apatriarca
Member Since 03 Jul 2006Offline Last Active Today, 01:05 AM
Community Stats
 Group Crossbones+
 Active Posts 871
 Profile Views 10,997
 Submitted Links 0
 Member Title Member
 Age 31 years old
 Birthday February 11, 1985

Gender
Male

Location
Torino, Italy
#5145703 Quaternions rotation code
Posted by apatriarca on 09 April 2014  09:55 AM
#5145085 Rotate a quaternion
Posted by apatriarca on 07 April 2014  10:44 AM
If you want to combine rotations, you have to multiply together the two quaternions. If q_1 is the first rotation and q_2 is the second rotation, then q_2*q_1 is the rotation obtained by first rotating using q_1 and then q_2. q_1*q_2 is the rotation obtained by first rotating using q_2 and then q_1. Indeed, q_2*q_1*v*(q_2*q_1)^{1} = q_2*(q_1*v*q_1^{1})*q_2^{1}.
#5142607 draw 2d line with clipping
Posted by apatriarca on 27 March 2014  09:56 AM
There is no need to execute the loop to obtain the correct values of x, y and error. The error is simply the vertical distance from the line to the current pixel. If (x_0, y_0) the better approximation of the first pixel to draw on the screen and y = m*x + q is the line equation, then error = m*x_0 + q  y_0. You should then be able to draw the following pixels without problems.
#5142534 Help with Plasticity formula.
Posted by apatriarca on 27 March 2014  05:30 AM
That arrow is usually used when describing algorithms and represents an assignment, an update of the variable the arrow points to. S^{p}  I_{2} is the spectral norm of the matrix S^{p}  I. The spectral norm of a matrix A is the square root of the maximum eigenvalue of A^{H}A where A^{H} is the conjugate transpose of A (the transpose if the matrix is real).
#5140930 Quaternions: convert between LeftRight handed without using Euler
Posted by apatriarca on 21 March 2014  06:09 AM
Let M be the (3x3) transformation matrix between the Blender coordinate system and the Unity one. Then the axis is simply transformed using M and the angle should change sign (since M does not preserve the orientation). You thus have to negate the imaginary part and then apply M to it.
EDIT:
The transformation between Blender and Unity coordinate systems is, if I remember correctly, (x, y, z) > (y, z, x). If I thus have a quaternion q0 + q1*i + q2*j + q3*k, the corresponding quaternion should be q0  q2*i  q3*j +q1*k.
#5140688 Inverse Proportion and Zero
Posted by apatriarca on 20 March 2014  09:57 AM
I'm not sure I understood your post. Anyway, what about (10  x)*25.5 ? It is equal to 255 when x is zero and equal to 0 when x is 10.
#5134720 This is what atan2() does if given two Vector2D points on 2D plane?
Posted by apatriarca on 26 February 2014  05:07 AM
There is no need to convert these vectors to angles to compute a rotation matrix. All you need to compute a rotation matrix in 2D are the cosine and sine of the angle and you already have them encoded in the direction of the difference vector. You indeed simply have to normalize the difference vector:
(cos(angle), sin(angle) ) = normalize(P2  P1).
If you think you have to compute the angle to compare them between different fingers positions, then it is not true again. If P3 and P4 are different positions of your fingers, then you can compute the cosine and sine of the rotation angle between the two vectors by simply using a complex division. If do not know complex numbers I suggest to learn about them, but you can implement the division using the following formula:
(a, b) / (c, d) = ( a*c + b*d, b*c  a*d ) / (c*c + d*d).
#5125823 .obj file loader
Posted by apatriarca on 23 January 2014  03:30 AM
Is there any reason you are using (*model).GetIndices() instead of model>GetIndices() ?
#5125637 Barycentric coordinates of circumcenter of tetrahedron
Posted by apatriarca on 22 January 2014  08:10 AM
The steps in the derivation are very similar to the steps in the triangle case and you should get:
Dot(BA,BA)*s + Dot(BA,CA)*t + Dot(BA,DA)*u = (1/2)*Dot(BA,BA)
Dot(CA,BA)*s + Dot(CA,CA)*t + Dot(CA,DA)*u = (1/2)*Dot(CA,CA)
Dot(DA,BA)*s + Dot(DA,CA)*t + Dot(DA,DA)*u = (1/2)*Dot(DA,DA)
which you can then solve using Cramer's rule (or something else).
#5125616 Mathematics for 3D programming  Exercises
Posted by apatriarca on 22 January 2014  05:01 AM
Making a simple 3D game/tech demo or a ray tracer or .. is IMHO probably one of the best way to exercise those math skills.
#5123310 Need a design advice on a Mesh Class
Posted by apatriarca on 13 January 2014  10:53 AM
If Context::CreateBuffer calls Mesh::CreateBuffer you have an infinite loop. This is in my opinion the main reason to avoid doing that.
#5123269 shadows in 2d
Posted by apatriarca on 13 January 2014  07:18 AM
I guess it depends on the type of game you are working on (i.e. where is the camera and the relative positions of lights and objects) but it can be done. For example, this article on gamedev explains a technique to implement soft shadows in 2D.
#5117517 Genetic algorithm in a game
Posted by apatriarca on 17 December 2013  02:44 AM
#5115643 OpenGl as a blitter
Posted by apatriarca on 09 December 2013  07:43 AM
P.S. If you really want to learn about OpenGL, I suggest to start using the modern APIs. The programmable pipeline is now common in the mobile and Web world too.
#5114300 Using one instance of Behaviour Tree for many agents?
Posted by apatriarca on 04 December 2013  07:07 AM