You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if it would make sense to add a look_at() function for this library for initializing an SE3 transformation matrix. I personally use this when positioning a camera etc. where I want the camera at an exact position, look at a specific point, and define which axis is up. This makes defining the pose of the camera very easy. I use an implementation of this function in mitsuba2, where the parameters are
origin: defines the translation part of the matrix
target: the target point the z-axis should point towards
up: the direction which is perpendicular with the x-axis of the transform and the direction of the vector from the origin to the target
Examples
Below are a couple of examples of how the function works in Mitsuba2
The Mitsuba implementation only works for pointing the z-axis at a specific direction defined by the direction of the vector between the origin and the target. The up-axis is also predefined to specify a specific axis in the resulting transformation matrix. For generalization of the function, it could make sense to specify which axes should point toward to target, and which axis is up. This will however complicate the function further. One could split the functionality into three functions for example:
That's a nice idea. Since it works like a constructor it should start with a capital letter for consistency. We could have an additional string argument, axis, which perhaps defaults to 'z' to handle your general case. So, how about SE3.LookAt(origin, target, up, axis)?
Feature description
I was wondering if it would make sense to add a look_at() function for this library for initializing an SE3 transformation matrix. I personally use this when positioning a camera etc. where I want the camera at an exact position, look at a specific point, and define which axis is up. This makes defining the pose of the camera very easy. I use an implementation of this function in mitsuba2, where the parameters are
Examples
Below are a couple of examples of how the function works in Mitsuba2
Example 1
Example 2
Mitsuba C++ implementation
Source: https://github.com/mitsuba-renderer/mitsuba2/blob/ab5a49d4199a1b08d4d6557dfe6b0336fff4cfdf/include/mitsuba/core/transform.h
Generalization
The Mitsuba implementation only works for pointing the z-axis at a specific direction defined by the direction of the vector between the origin and the target. The up-axis is also predefined to specify a specific axis in the resulting transformation matrix. For generalization of the function, it could make sense to specify which axes should point toward to target, and which axis is up. This will however complicate the function further. One could split the functionality into three functions for example:
Does this makes sense for anyone else, or would it bloat the code and documentation?
The text was updated successfully, but these errors were encountered: