本文整理汇总了C++中Face::CalcArea方法的典型用法代码示例。如果您正苦于以下问题:C++ Face::CalcArea方法的具体用法?C++ Face::CalcArea怎么用?C++ Face::CalcArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Face
的用法示例。
在下文中一共展示了Face::CalcArea方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: do_tesselate_face
bool do_tesselate_face( const Face &F, tesscb_estimator* cb_E, int &max_id )
{
if (F.CalcArea()<EPS_L)
return false;//continue;
max_id = cb_E(&F);
if (max_id<0)
return false;//continue; // nothing selected
return true;
}
示例2: OA_Export
void CDeflector::OA_Export()
{
if (UVpolys.empty()) return;
// Correct normal
// (semi-proportional to pixel density)
FPU::m64r ();
Fvector tN;
tN.set (0,0,0);
float density = 0;
float fcount = 0;
for (UVIt it = UVpolys.begin(); it!=UVpolys.end(); it++)
{
Face *F = it->owner;
Fvector SN;
SN.set (F->N);
SN.mul (1+EPS*F->CalcArea());
tN.add (SN);
density += F->Shader().lm_density;
fcount += 1.f;
}
if (tN.magnitude()>EPS_S && _valid(tN)) normal.set(tN).normalize();
else clMsg("* ERROR: Internal precision error in CDeflector::OA_Export");
density /= fcount;
// Orbitrary Oriented Ortho - Projection
Fmatrix mView;
Fvector at,from,up,right,y;
at.set (0,0,0);
from.add (at,normal);
y.set (0,1,0);
if (_abs(normal.y)>.99f) y.set(1,0,0);
right.crossproduct(y,normal); right.normalize_safe();
up.crossproduct(normal,right); up.normalize_safe();
mView.build_camera(from,at,up);
Fbox bb; bb.invalidate();
for (UVIt it = UVpolys.begin(); it!=UVpolys.end(); it++)
{
UVtri *T = &*it;
Face *F = T->owner;
Fvector P; // projected
for (int i=0; i<3; i++) {
mView.transform_tiny (P,F->v[i]->P);
T->uv[i].set (P.x,P.y);
bb.modify (F->v[i]->P);
}
}
bb.getsphere(Sphere.P,Sphere.R);
// UV rect
Fvector2 min,max,size;
GetRect (min,max);
size.sub (max,min);
// Surface
u32 dwWidth = iCeil(size.x*g_params.m_lm_pixels_per_meter*density+.5f); clamp(dwWidth, 1u,512u-2*BORDER);
u32 dwHeight = iCeil(size.y*g_params.m_lm_pixels_per_meter*density+.5f); clamp(dwHeight,1u,512u-2*BORDER);
layer.create (dwWidth,dwHeight);
}