Get/Set HPB ? posible?



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

    On 20/05/2010 at 18:35, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   11.5 
    Platform:   Windows  ;   
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    I tried not to post until i researched a lot, and I just can't get this to work :P ...

    I just want to get or set Rotation values as HPB ,with COFFEE,  like the cinema4D works, i can only set rotation with SetRotation, and in vectors, but i want to use the HPB degrees values , as in the c4d interface.

    Example: i have a cube,  I want to set Rotation 45° to H... or get the H value (45).

    Hope someone can save me from this headache :P
    Thanks in advance.



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

    On 21/05/2010 at 06:22, xxxxxxxx wrote:

    The BaseObject GetRotation() function returns a vector containing the object's HPB rotation. That is, the returned vector x component holds the H value, y is P, z is B. SetRotation() works in the same way.

    Try this in the script manager with an object selected:

    main(doc, op)
    {
         op->SetRotation(vector(0.0, 0.5, 0.0));
    }

    This will set the P rotation of the object to 0.5 (note that these functions work with radians, not degrees - 0.5 radians is 28.648 degrees).

    Note also that this only gets/sets local rotations. If you want the global rotation, you'll have to use a matrix. See the excellent tutorial on matrices in the COFFEE SDK.



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

    On 22/05/2010 at 02:33, xxxxxxxx wrote:

    Side note:

    When dealing with the SDK, you are hopefully aware that all angles are radians, not °... i.e. H is not 45, but π/4 ≈ 0.79.


Log in to reply