本文整理汇总了C++中Float3::GetCross方法的典型用法代码示例。如果您正苦于以下问题:C++ Float3::GetCross方法的具体用法?C++ Float3::GetCross怎么用?C++ Float3::GetCross使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Float3
的用法示例。
在下文中一共展示了Float3::GetCross方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Dice
//.........这里部分代码省略.........
Color( h, h, h ),
};
*/
static int cnt;
useColor = palette[ cnt++ & 15 ];
useOpa = SlColor( 1, 1, 1 );
}
else
{
useColor = mpAttribs->mColor;
useOpa = mpAttribs->mOpacity;
}
// build the UVs
Float2_ locUV[ MP_GRID_MAX_SIZE_SIMD_BLKS ];
Float2_ locDUDV[ MP_GRID_MAX_SIZE_SIMD_BLKS ];
fillUVsArray( locUV, locDUDV, du, dv, g.mXDim, g.mYDim );
//DASSERT( sampleIdx == g.mPointsN );
size_t blocksN = DMT_SIMD_BLOCKS( g.mPointsN );
Float_ one( 1.0f );
for (size_t blkIdx=0; blkIdx < blocksN; ++blkIdx)
{
#if 1
Float3_ dPdu;
Float3_ dPdv;
Float3_ posLS;
Eval_dPdu_dPdv( locUV[blkIdx], posLS, &dPdu, &dPdv );
if ( posLS[0][0] == 0 && posLS[0][1] == 0 && posLS[0][2] == 0 )
continue;
Float3_ norLS = dPdu.GetCross( dPdv ).GetNormalized();
Float3_ posCS = V3__V3W1_Mul_M44<Float_>( posLS, g.mMtxLocalCamera );
Float3_ norCS = V3__V3W1_Mul_M44<Float_>( norLS, mtxLocalCameraNorm ).GetNormalized();
pP[blkIdx] = posCS;
pI[blkIdx] = (posCS - -camPosCS);//.GetNormalized();
pOODu[blkIdx] = one / locDUDV[blkIdx][0];
pOODv[blkIdx] = one / locDUDV[blkIdx][1];
pu[blkIdx] = locUV[blkIdx][0];
pv[blkIdx] = locUV[blkIdx][1];
pN[blkIdx] = norCS;
pNg[blkIdx] = norCS;
pOs[blkIdx] = useOpa;
pCs[blkIdx] = useColor;
#else
Float2_ &tmpvblk = locUV[ blkIdx ];
for (size_t itmIdx=0; itmIdx < DMT_SIMD_FLEN; ++itmIdx)
{
Float3 dPdu;
Float3 dPdv;
Float3 posLS;
Eval_dPdu_dPdv( locUV[ blkIdx ][0][ itmIdx ],
locUV[ blkIdx ][1][ itmIdx ],
posLS,
&dPdu,
&dPdv );
Float3 norLS = dPdu.GetCross( dPdv ).GetNormalized();
Float3 posWS = V3__V3W1_Mul_M44<float>( posLS, g.mMtxLocalWorld );
Float3 posCS = V3__V3W1_Mul_M44<float>( posLS, g.mMtxLocalCamera );
Float3 norCS = V3__V3W1_Mul_M44<float>( norLS, mtxLocalCameraNorm ).GetNormalized();
// store in blocked SOA format
pP[blkIdx][0][itmIdx] = posWS[0];
pP[blkIdx][1][itmIdx] = posWS[1];
pP[blkIdx][2][itmIdx] = posWS[2];
Float3 tmpI = (posCS - -camPosCS).GetNormalized();
pI[blkIdx][0][itmIdx] = tmpI[0];
pI[blkIdx][1][itmIdx] = tmpI[1];
pI[blkIdx][2][itmIdx] = tmpI[2];
pN[blkIdx][0][itmIdx] = norCS[0];
pN[blkIdx][1][itmIdx] = norCS[1];
pN[blkIdx][2][itmIdx] = norCS[2];
pNg[blkIdx][0][itmIdx] = norCS[0];
pNg[blkIdx][1][itmIdx] = norCS[1];
pNg[blkIdx][2][itmIdx] = norCS[2];
}
pOs[blkIdx] = useOpa;
pCs[blkIdx] = useColor;
#endif
}
}