Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int x = 0; x < WIDTH; x++) {
- double xDepth = (x - WIDTH / 2.0) / HEIGHT;
- xDepth *= z;
- double xx = xDepth * cosine + z * sine;
- double yy = z * cosine - xDepth * sine;
- int xPix = (int) (xx + right);
- int yPix = (int) (yy + forward);
- zBuffer[x+y*WIDTH] = z;
- pixels[x+y*WIDTH] = ((xPix & 15) * 16) | ((yPix & 15) * 16) << 8;
- }
Add Comment
Please, Sign In to add comment