panda3d / panda3d-docs

Sphinx documentation for Panda3D
https://docs.panda3d.org
47 stars 53 forks source link

Better documentation of lookAt and headsUp #99

Open Germanunkol opened 3 years ago

Germanunkol commented 3 years ago

Description

In the documentation, the lookAt and headsUp functions (and their various overloads) could use some more explanation, I think.

Here are some questions I had that the Docs dont't answer, in my opinion:

rdb commented 2 years ago

For the record, documentation of heads-up:

Given two vectors defining a forward direction and an up vector, constructs the matrix that rotates things from the defined coordinate system to y-forward and z-up. The up vector will be rotated to z-up first, then the forward vector will be rotated as nearly to y-forward as possible. This will only have a different effect from look_at() if the forward and up vectors are not perpendicular.

Documentation of look-at:

Given two vectors defining a forward direction and an up vector, constructs the matrix that rotates things from the defined coordinate system to y-forward and z-up. The forward vector will be rotated to y-forward first, then the up vector will be rotated as nearly to z-up as possible. This will only have a different effect from heads_up() if the forward and up vectors are not perpendicular.

So, one will prefer aligning the object with the Y axis, the other will prefer aligning it with the Z axis.

The other argument works like it does in other NodePath operations: it indicates which space the other parameters are relative to, the default being the NodePath's own parent.

I am not sure where exactly in the manual this information would fit, did you have a suggestion?