MCPcopy Create free account
hub / github.com/alicevision/AliceVision / computeNormalHeight

Function computeNormalHeight

src/aliceVision/mesh/Texturing.cpp:263–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263inline void computeNormalHeight(const GEO::Mesh& mesh,
264 double orientation,
265 double t,
266 GEO::index_t f,
267 const Eigen::Matrix3d& m,
268 const GEO::vec3& q,
269 const GEO::vec3& qA,
270 const GEO::vec3& qB,
271 float& out_height,
272 image::RGBfColor& out_normal)
273{
274 GEO::vec3 intersectionPoint = t * qB + (1.0 - t) * qA;
275 out_height = q.distance(intersectionPoint) * orientation;
276
277 // Use facet normal
278 // GEO::vec3 denseMeshNormal_f = normalize(GEO::Geom::mesh_facet_normal(mesh, f));
279 // Use per pixel normal using weighted interpolation of the facet vertex normals
280 const GEO::vec3 denseMeshNormal = mesh_facet_interpolate_normal_at_point(mesh, f, intersectionPoint);
281
282 Eigen::Vector3d dNormal = m * toEigen(denseMeshNormal);
283 dNormal.normalize();
284 out_normal = image::RGBfColor(dNormal(0), dNormal(1), dNormal(2));
285}
286
287void Texturing::generateUVsBasicMethod(mvsUtils::MultiViewParams& mp)
288{

Callers 1

Calls 3

toEigenFunction · 0.70
normalizeMethod · 0.45

Tested by

no test coverage detected