unibas-gravis / scalismo-faces

Scalable Image Analysis and Shape Modelling: Module to work with 2d images, with a focus on face images
Apache License 2.0
118 stars 27 forks source link

ParametricRenderer does wrong back-face culling for non-neutral camera poses #125

Closed Andreas-Forster closed 5 years ago

Andreas-Forster commented 5 years ago

The current implementation of scalismo.faces.parameters.ParametricRenderer does wrong back-face culling when the parameters describe a camera with the eye position not in the origin. The problematic lines are here.

While the mesh is transformed into camera coordinates, the eye position is passed in world coordinates. The solution is either to use here the origin as eye position in the camera coordinate system or to transform the mesh only to the world coordinate system by applying the parameter.pose transform instead of the parameter.modelViewTransform.