本文整理汇总了C++中FrameBuffer::GetV方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameBuffer::GetV方法的具体用法?C++ FrameBuffer::GetV怎么用?C++ FrameBuffer::GetV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameBuffer
的用法示例。
在下文中一共展示了FrameBuffer::GetV方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
//.........这里部分代码省略.........
tcols.getColumn(1) * Q.getColumn(2));
Vector3D ABCb = Vector3D(
tcols.getColumn(2) * Q.getColumn(0),
tcols.getColumn(2) * Q.getColumn(1),
tcols.getColumn(2) * Q.getColumn(2));
Vector3D ABCk = Vector3D(Q[1]);
Vector3D ABCl = Vector3D(Q[2]);
Matrix3x3 tst = Matrix3x3();
Vector3D ABCs, ABCt;
if(textured){
tst[0] = st[vinds[0]];
tst[1] = st[vinds[1]];
tst[2] = st[vinds[2]];
ABCs = Vector3D(
tst.getColumn(0) * Q.getColumn(0),
tst.getColumn(0) * Q.getColumn(1),
tst.getColumn(0) * Q.getColumn(2));
ABCt = Vector3D(
tst.getColumn(1) * Q.getColumn(0),
tst.getColumn(1) * Q.getColumn(1),
tst.getColumn(1) * Q.getColumn(2));
}
//Rasterization
for(int v = top; v <= bottom; v++){
for(int u = left; u <= right; u++){
Vector3D pixv = Vector3D(0.5f + (float)u, 0.5f + (float)v, 1.0f);
if(pixv * eeqs[0] < 0.0f || pixv * eeqs[1] < 0.0f || pixv * eeqs[2] < 0.0f){
continue;
}
if(((normalABCs*pixv).normalize() * ppc->GetVD())>=0){
continue;
}
float currZ = zABC * pixv;
Vector3D currP = Vector3D(pixv[0], pixv[1], currZ);
if(!fb->CloserThenSet(currP)){
continue;
}
Vector3D currC;
//currC = colABCs * pixv; //SS Interpolation
currC[0] = (ABCr*pixv) / (DEF*pixv); //MS Interpolation
currC[1] = (ABCg*pixv) / (DEF*pixv);
currC[2] = (ABCb*pixv) / (DEF*pixv);
if(textured){
Vector3D texel = Vector3D();
texel[0] = (ABCs*pixv)/(DEF*pixv);
texel[1] = (ABCt*pixv)/(DEF*pixv);
FrameBuffer * currTexture = texs[triToTexMap[currTri]];
if(texRepetition){
texel[0] = (int)(texel[0]*currTexture->w) % currTexture->w;
texel[1] = (int)(texel[1]*currTexture->h) % currTexture->h;
}else if(texMirror){
if((int)((texel[0]*currTexture->w) / currTexture->w) % 2 == 0){
texel[0] = (int)(texel[0]*currTexture->w) % currTexture->w;