本文整理汇总了C++中MNMesh::ExtrudeFaceClusterAlongPath方法的典型用法代码示例。如果您正苦于以下问题:C++ MNMesh::ExtrudeFaceClusterAlongPath方法的具体用法?C++ MNMesh::ExtrudeFaceClusterAlongPath怎么用?C++ MNMesh::ExtrudeFaceClusterAlongPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MNMesh
的用法示例。
在下文中一共展示了MNMesh::ExtrudeFaceClusterAlongPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Do
void PolyOpExtrudeAlongSpline::Do (MNMesh & mesh) {
if (mpSpline == NULL) return;
Tab<Matrix3> tTransforms;
theFrenetFinder.ConvertPathToFrenets (mpSpline, mSplineXfm, tTransforms,
mSegments, mAlign?true:false, mRotation);
// Apply taper and twist to transforms:
float denom = float(tTransforms.Count()-1);
for (int i=1; i<tTransforms.Count(); i++) {
float amount = float(i)/denom;
// This equation taken from Taper modifier:
float taperAmount = 1.0f + amount*mTaper + mTaperCurve*amount*(1.0f-amount);
if (taperAmount != 1.0f) {
// Pre-scale matrix by taperAmount.
tTransforms[i].PreScale (Point3(taperAmount, taperAmount, taperAmount));
}
if (mTwist != 0.0f) {
float twistAmount = mTwist * amount;
tTransforms[i].PreRotateZ (twistAmount);
}
}
// Note:
// If there are multiple face clusters, the first call to ExtrudeFaceClusterAlongPath
// will bring mesh.numf and fClust.clust.Count() out of synch - fClust isn't updated.
// So we fix that here.
MNFaceClusters fClust (mesh, MN_USER);
for (i=0; i<fClust.count; i++) {
if (mesh.ExtrudeFaceClusterAlongPath (tTransforms, fClust, i, mAlign?true:false)) {
if (i+1<fClust.count) {
// New faces not in any cluster.
int oldnumf = fClust.clust.Count();
fClust.clust.SetCount (mesh.numf);
for (int j=oldnumf; j<mesh.numf; j++) fClust.clust[j] = -1;
}
}
}
}