Closed Andreas-Forster closed 5 years ago
An easy example to compare the rendering before and after the PR is the following app. The to images should be identical up to the illumination. But before this PR the backface culling removes half of the face in the side view:
object BackfaceCullingTest extends App {
scalismo.initialize()
val momo = scalismo.faces.io.MoMoIO.read(new File("model2017-1_face12_nomouth.h5")).get
val frontal = RenderParameter.defaultSquare.withMoMo(MoMoInstance.fromCoefficients(momo.zeroCoefficients,new File("").toURI))
val renderer = MoMoRenderer(momo)
val sideView = frontal.copy(
pose = frontal.pose.copy(yaw = 0.5*Math.PI),
view = frontal.view.copy(yaw = 0.5*Math.PI,translation = EuclideanVector(-frontal.pose.translation.z,0,frontal.pose.translation.z))
)
ImagePanel(renderer.renderImage(frontal)).displayIn("frontal")
ImagePanel(renderer.renderImage(sideView)).displayIn("sideView")
}
Thanks for fixing this!
The ParametricRenderer did a the backface culling wrong for settings where the camera is not in the origin. The worldMesh is the transformed mesh by applying the model-view transform. This transformation includes object pose and camera pose. Hence after this transformation the eye position is in the coordinate origin and no longer at the position specified in the RenderParameter.
This PR corrects the backfaceCullingFilter to use the origin instead of the RenderParameter.view.eyePosition.
EDIT: In addition this PR also updated the .travis.yml file so that the intergration check is now up and running again.