Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while(x < cellsx && x >= 0 && y < cellsy && y >= 0
- && z < cellsz && z >= 0)
- {
- voxelValue = model[z * (cellsy) * (cellsx) + y * (cellsx) + x ];
- alpha = (voxelValue & 0xF0)/256.0;
- if (alpha < 1 - alphaSencity) alpha = 0;
- if (alpha > 0)
- {
- color = (voxelValue & 0xF)/16.0;
- if (color > colorSencity) color = 1;
- prevColor = alpha*prevColor + (1 - alpha) * color;
- if (prevColor <= 0)
- {
- prevColor = 0;
- break;
- }
- }
- //qDebug() << x << y << z;
- if(ray.x() && tMaxX <= tMaxY && tMaxX <= tMaxZ)
- {
- tMaxX += tDeltaX;
- x += stepX;
- }
- else if(ray.y() && tMaxY <= tMaxZ && tMaxY <= tMaxX)
- {
- tMaxY += tDeltaY;
- y += stepY;
- }
- else
- {
- tMaxZ += tDeltaZ;
- z += stepZ;
- }
- }
Add Comment
Please, Sign In to add comment