**THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED**

*On 07/05/2008 at 22:07, xxxxxxxx wrote:*

User Information:

Cinema 4D Version: R9-R10.5

Platform: Windows ; Mac ; Mac OSX ;

Language(s) : C++ ;

---------

Okay. It took me years to understand this stuff a little better (I literally hate 3D rotations). First, reading the C4D manual "Coordinate System: Why use HPB?" cleared up some serious misunderstandings. First, it says that C4D always stores the representation as HPB internally. That I figured. The second thing it says is something about how the rotations are about the parent's system (at least two of them anyway?). That got me thinking here.

C4D HPB - rotations about parent system.

Tait-Bryan - rotations about local system (which gives you that beautiful gimbal lock).

Now, Tait-Bryan rotations are so-called Euler 1-2-3 rotations. That is XYZ, XZY, YXZ, YZX, ZXY, ZYX. These are ordered, non-communative, and non-communative from one order to another (as far as I know).

So, now that I can frame the question a bit more knowledgeably, here goes. ;)

1. How the fiddle-sticks do I convert HPB rotations (probably from what is stored in the local matrix or derived from GetRot() and HPBToMatrix()) into Tait-Bryan rotations accurately and without these anomalies?:

(90°, 45°, −105°) ≡ (−270°, −315°, 255°) multiples of 360°

(72°, 0°, 0°) ≡ (40°, 0°, 32°) singular alignment

(45°, 60°, −30°) ≡ (−135°, −60°, 150°) bistable flip

These are pretty much what I see in my matrix decompositions of the HPB matrix but my results may more likely be a result of the fact that these two rotation systems have these differing interpretations which I have not taken into account - and aren't accounted for in other Matrix-to-Euler conversion algorithms (namely the systems being rotated?). There must be a difference in the matrices since the results speak for themselves - years of failure.

Two other questions:

2. Is there a more specific name for your HPB system (since 'HPB' seems to be practically ubiquitous everywhere as a usual Euler rotation system yet associated with gimbal lock). I can't find any so-called HPB system that doesn't describe itself as a typical Euler rotation system which suffers the same anomalies as others. Any accessible documentation or books or papers that give a more thorough explanation. Considering the myriad forms and names and symbologies and representations of 3D rotations (and the gazillions of books, papers, online resources), it is hard to find *the* system upon which your HPB is based. You say that it is hard to understand. It would be easier if the details were laid bare from their source.

3. Although you'd like to think that this isn't your problem, the fact that I can't find any conversion/decomposition algorithms that consider a change in coordinate system (as odd as yours) in the extraction of Euler rotations suggests that would you consider, please, supplying some information in this regard? (like how I finegalled that into a question) ;)

You can see that I'm obsessed and resilient with this pursuit of mine. The reason is that it would open up multitudes of doorways that are currently locked tight. I had to implement my own rotation tools since there has been no way to go HPB->TB (a darned lot of work). I had to implement (badly) an IK system since there has been no way to go HPB->TB (a lot of work for little success). Users cannot use things like CactusDan's CD plugins because of this. Users can't animate HPB but only the TB representations.

Looking at the code such as MatrixToHPB() doesn't really *tell* me anything. This stuff is sooo complex, yes, I really need hand-holding to find the path to results.

ETA: And even here the terminology befuddles all senses. Supposedly, Tait-Bryan is akin to your HPB (where I have read otherwise) and Euler 1-2-3 is just Euler - or is it or is it something else. My god people (generally - mathematicians), please consolidate your definitions and stop bandying them about in misconstruing ways. This is one reason why I HATE 3D rotations. Standards, we don't need no shtinkin' standards... (just do some comparative readings and you'll see how fragged up it is).

Thanks,