本文整理汇总了C++中Matrix3x3::transpose方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix3x3::transpose方法的具体用法?C++ Matrix3x3::transpose怎么用?C++ Matrix3x3::transpose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix3x3
的用法示例。
在下文中一共展示了Matrix3x3::transpose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
//.........这里部分代码省略.........
Vector3D eyeV;
Vector3D reflectedToPL;
for(int i = 0; i < 3; i++){
toPL = (pl->pos - verts[vinds[i]]).normalize();
norm = (normals[vinds[i]]).normalize();
eyeV = (ppc->C - verts[vinds[i]]).normalize();
reflectedToPL = (2.0f * norm * (norm * toPL) - toPL).normalize();
kdiff = toPL * norm;
if(kdiff < 0.0f){
kdiff = 0.0f;
}
float temp = reflectedToPL * eyeV;
if(temp < 0){
temp = 0;
}
kspec = pow(temp, phongExp);
if(norm * toPL < 0){
kspec = 0;
}
tcols[i] = tcols[i] * (kamb + (1.0f - kamb) * kdiff + kspec);
}
}
Matrix3x3 colABCs = ssii*tcols;
colABCs = colABCs.transpose();
//Z buffer interpolation
Vector3D tzs = Vector3D(projVerts[vinds[0]][2], projVerts[vinds[1]][2], projVerts[vinds[2]][2]);
Vector3D zABC = ssii * tzs;
//Normal interpolation
Matrix3x3 tnormals = Matrix3x3();
Matrix3x3 normalABCs = Matrix3x3();
if(normals != NULL){
tnormals[0] = normals[vinds[0]];
tnormals[1] = normals[vinds[1]];
tnormals[2] = normals[vinds[2]];
normalABCs = ssii*tnormals;
normalABCs = normalABCs.transpose();
}
//Model Space Interpolation
Matrix3x3 camM;
camM.setColumn(0,ppc->a);
camM.setColumn(1,ppc->b);
camM.setColumn(2,ppc->c);
Matrix3x3 triM;
triM.setColumn(0, verts[vinds[0]] - ppc->C);
triM.setColumn(1, verts[vinds[1]] - ppc->C);
triM.setColumn(2, verts[vinds[2]] - ppc->C);
Matrix3x3 Q = triM.inverse() * camM;
Vector3D DEF = Q[0] + Q[1] + Q[2];
Vector3D ABCr = Vector3D(
tcols.getColumn(0) * Q.getColumn(0),
tcols.getColumn(0) * Q.getColumn(1),
tcols.getColumn(0) * Q.getColumn(2));