Quaternion multiplication is not a rotation. Quaternions rotate a vector through conjugation qvq^{1}. Your function multiplyQuat is thus either named wrong or it has been used in the wrong way.
 Home
 » Viewing Profile: Reputation: apatriarca
apatriarca
Member Since 03 Jul 2006Offline Last Active Today, 09:48 AM
Community Stats
 Group Crossbones+
 Active Posts 865
 Profile Views 10,539
 Submitted Links 0
 Member Title Member
 Age 31 years old
 Birthday February 11, 1985

Gender
Male

Location
Torino, Italy
#5233168 Moving around a sphere with quaternions
Posted by apatriarca on 06 June 2015  11:00 AM
#5227301 Nav mesh determining neighbours efficiently
Posted by apatriarca on 05 May 2015  07:53 AM
#5204711 [Solved] Vector prime notation, what does it mean?
Posted by apatriarca on 16 January 2015  08:25 AM
#5202488 inverted GJK  you're a genius if you can solve this
Posted by apatriarca on 06 January 2015  10:31 PM
I would simply subdivide the mothership's concave shape in the union of a set of (not necessarily disjoint) convex shapes. If the small ship intersect any of them, it intersects the mothership. This is simpler to implement than trying to add additional steps to handle each hole or inset separately.
#5201003 Bezier triangle partial secondorder derivatives
Posted by apatriarca on 31 December 2014  10:52 AM
EDIT: To arrive at this result you have to use the observation at the end of Shnoutz post in the discussion you have linked. You first derivate the Bernestein polynomials and then change the indices.
EDIT2: The derivatives in the gamasutra article are clearly wrong since partial derivatives are vectors while that formula defines a point. In the formulas above each "control point" is a vector since it is a linear combination of point whose coefficients sum to zero. In computer graphics we usually use vectors and points interchangeably, but they are different mathematical objects and it is sometimes useful to consider their differences when verifying an equation.
#5196265 Matrix right hand to left hand problem
Posted by apatriarca on 04 December 2014  10:03 AM
#5185230 Is upper division Linear Algebra a good idea or necessary?
Posted by apatriarca on 06 October 2014  01:49 AM
OpenGL uses the same data type for several different things, not just geometric vectors. In particular, it uses them for colors. The componentwise multiplication is in fact very useful in this case. Code implementations of mathematical concepts are rarely completely equivalent to their theoretical version.In Opengl, the operation is component wise multiply, though it has no sence to be used in manner of geomteric need, it ields a vector space where column and row vectors are the same, implying certain inpropriatness of talking about transposing a matrix, since it transposes by its order with multiply operation (that is impossible in linear algebra becouse of NxM demand in mutipling matricies/vectors, implying also vectors to be nx1x1xm, but that algebra has its definition of operation, that opengl does differ in (it will multiply vectors without their dimension introduced), thus opengl has a vector space of different properties where multiplication is not associative but it is a vector space).
#5181038 OIT (Order Independent Transparency)
Posted by apatriarca on 17 September 2014  10:10 AM
The Intel solution is based on a quite recent and, as far as I know, Intelonly extension. The Weighted Blended OIT is more general, but it is an approximation. There are also other methods (Abuffers for example). I don't think this is a solved problem and in many cases sorting is still probably the way to go. The best method depends on what you are trying to do and the scene you are trying to display.
#5180962 Formulas, Math, and theories for RPG combat/leveling systems?
Posted by apatriarca on 17 September 2014  04:09 AM
IMHO If you want low level players/monsters to have a chance against higher level ones, then you should rely less on stats and add more depth and strategy to your combat system. This is in fact the only way a weaker individual can beat a stronger one in real life too. If you have to fight with a boxer, you try to stay at the distance. If you are fighting with someone with a gun, you hide and try to disarm or use surprise or..
#5162268 Editing Bezier Splines while maintaining C1 Continuity
Posted by apatriarca on 23 June 2014  01:46 AM
To maintain C1 continuity between consecutive (cubic) Bézier splines you have to maintain the following equations:
P3(i1)  P2(1) = P1(i)  P0(i)
P3(i1) = P0(i)
where the index in the parenthesis represents the index of the curve in the spline. The derivative/tangent at the beginning (end) of Bézier curve is in fact parallel to the edge between the first two (last two) control points. If the two curves have different degree you have to multiply each part of the equation with the degree of the corresponding curve.
#5148706 Can you quickly visualize how a quaternion would look on top of your head?
Posted by apatriarca on 22 April 2014  06:48 AM
If you take a general quaternion like 0.6 + 0.3*i + 0.2*j  0.71*k you may first look at the real part and observe this should be equal to cos(alpha/2) for some angle alpha. 0.6 is greater than 0.5 which is the cosine of 60 degrees, but less then sqrt(2)/2 ~= 0.71 which is the cosine of 45 degrees. It should then be something in between, let's say 52.5 which is in the middle (the correct angle is 53.13 degrees) and thus we have a rotation of approximately 105 degrees around the axis defined by its imaginary part. This is basically how you can get a rough idea of what a quaternion does.
#5145766 Quaternions rotation code
Posted by apatriarca on 09 April 2014  02:49 PM
I do not know the Unity API, but I think it is the rotation around the axis cross((0, 1, 0), mFrontWheelNormal) with angle equal to the angle between the two vectors. The effect of the rotation should be to move something aligned with (0,1,0) to something aligned with mFrontWheelNormal.
#5145703 Quaternions rotation code
Posted by apatriarca on 09 April 2014  09:55 AM
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.
#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.