View Single Post
  #1  
Old 01-25-2012, 01:00 PM
pcatalano pcatalano is offline
Member
 
Join Date: Sep 2009
Posts: 22
setEuler argument/documentation confusion

Hello,

The documentation for the setEuler function (and some other rotation/translation functions) is, at least to me, misleading with respect to its arguments.

The doc lists:
Code:
<viewpoint>.setEuler(  
    [yaw,pitch,roll]      
    mask = viz.HEAD_ORI     # Positional argument 
    mode = viz.ABS_PARENT     # Positional argument 
)
However, this doesn't produce the correct results. For example:
Code:
viz.MainView.setEuler([90, 0, 0], mode = viz.REL_LOCAL)
will not rotate 90 degrees relative to local. The mode argument doesn't make a difference when the function is called this way.

The only way to get the desired results is to call like this
Code:
viz.MainView.setEuler(90, 0, 0, mode = viz.REL_LOCAL)
or
Code:
viz.MainView.setEuler([90, 0, 0], viz.HEAD_ORI, viz.REL_LOCAL)
I imagine this is why there is a comment "positional arguments" next to mask and mode arguments in the documentation, but, at least for me, the documentation doesn't clearly indicate the correct way to call the function (and it's easy to incorrectly call it and not realize it).
Reply With Quote