PDA

View Full Version : setEuler argument/documentation confusion


pcatalano
01-25-2012, 01:00 PM
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:
<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:
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
viz.MainView.setEuler(90, 0, 0, mode = viz.REL_LOCAL)
or
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).