Freestyle: Added utility function SilhouetteGeomEngine::CameraToImage().

TODO: Fix for Z normalization in SilhouetteGeomEngine methods.
This commit is contained in:
2014-05-21 11:38:14 +09:00
parent c829c71c57
commit 01ac74e4ad
2 changed files with 11 additions and 0 deletions

View File

@@ -319,4 +319,12 @@ Vec3r SilhouetteGeomEngine::WorldToImage(const Vec3r& M)
return newPoint;
}
Vec3r SilhouetteGeomEngine::CameraToImage(const Vec3r& M)
{
Vec3r newPoint, p;
GeomUtils::fromCameraToRetina(M, p, _projectionMatrix);
GeomUtils::fromRetinaToImage(p, newPoint, _viewport);
return newPoint;
}
} /* namespace Freestyle */

View File

@@ -131,6 +131,9 @@ public:
/*! From world to image */
static Vec3r WorldToImage(const Vec3r& M);
/*! From camera to image */
static Vec3r CameraToImage(const Vec3r& M);
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:SilhouetteGeomEngine")
#endif