Issue setting rotation

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

On 12/06/2009 at 16:03, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   r11 
Platform:   Windows  ;   
Language(s) :     C++  ;

---------
All of a sudden i cant set the angle properly:

> `

  
\>                                     GeData data;  
\>                                     obj->GetParameter(DescID(ID_BASEOBJECT_SCALE), data, 0L);  
\>                                     obj->SetParameter(DescID(ID_BASEOBJECT_SCALE), GeData(data.GetVector()*_resize), 0L);  
\>                                     obj->SetParameter(DescID(ID_BASEOBJECT_ROTATION), GeData(Vector(45,0,-45)), 0L);  
\>  

`

but the result in cinema is
2578.31 °
0
-2578.31 °

Whats that ?? I guess i just didnt notice that i am doing something wrong because i did a random plugin and thus didnt check the values as it looked ok to me...

is there a solution somewhere? why cant i set the same values via script that i can set inside cinema via the gui??

thanks for your help,
ello
thanks for your patience :)

cheers,
ello

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

On 12/06/2009 at 16:50, xxxxxxxx wrote:

Simple: All rotations are in Radians, not degrees.

I use these inline converters when the angles are variable:

inline Real ToRad(Real r) { return ((r)*0.017453292519943295769236907684886f); }
inline Real ToDeg(Real r) { return ((r)*57.295779513082320876798154814105f); }

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

On 13/06/2009 at 00:55, xxxxxxxx wrote:

thank you very much, it works but wow, where do those numbers come from?

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

On 13/06/2009 at 10:39, xxxxxxxx wrote:

PI/180 and 180/PI. Instead of doing the floating point math over and over (even inline), I simply put in constants. More precision than ever needed and beyond that of a 32-bit IEEE floating point encoding but I simply copy-pasted the values from the Windows Calculator. :)

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

On 13/06/2009 at 13:29, xxxxxxxx wrote:

it works totally cool.

i must generally thank you and all others here in this forum for all the help i find here. i hope someday i can return something

cheers,
ello