And the mnemonic about directions is really helpful, thank you! ]]>

while your formulae are correct, an explanation is missing

why in qp=(q0p0-q1p1-q2p2-q3p3,…. 3 components are subtracted

and in dot(q,p)=q0p0+q1p1+q2p2+q3p3.

It is so in complex and/or quaternion dot product one argument is

taken conjugate before multiplying so eg: q conjg(p) = (dot(q,p),….) ]]>

1) In the second example of the “rotations” part. It seems that the vector p = [2, 0, 0] revolves 60 degrees instead of 90 since the angle between p and v is 60. Therefore, the deduction of the “rotor” in quaternion form seems to be incorrect.

2) I try to get a formula of rotors in quaternion form and I get one. But somehow I could not get the correct result with p = [2, 0, 0] and v = [sqrt(2) / 2, 0, sqrt(2) / 2]. I calculated for more than 10 times, the formula seems to be correct.

(Here I ignore my uncertainties I talked about in 1))

The formula I get is:

q*p*inverse(p) = p + sin(theta) * cross(v, p) – sin(theta / 2) * sin(theta / 2) * cross(cross(v, p), v) ]]>

Sorry about that! I had 2 files with the same name and I accidentally linked the wrong one. The link has now been fixed (really this time).

]]>I’ve updated the link (again) and now with the correct link.

]]>your tutorial is really very helpful , but –

the ‘updated’ link seems to point to a wrong file, please check again.

Thanks

Kurt

Yes, I don’t show the application code but I’m clearing this buffer to 0 every frame before using it to perform light culling.

It is updated in the ForwardPlusRendering.hlsl shader on line 193 using an InterlockedAdd atomic function (to guarantee it is only updated by 1 thread at a time over the entire dispatch).

Does this answer your question?

]]>