I have a chessboard on XZ real plane (world).
Each tile of the pattern is of size 64*64;
How can I check what is the color of point (x,z) (white or black) ??
How can I make it efficient in C code ??
You have to look at the bit that’s worth 64, that is, the 6:th bit. Extract the 6:th bit from the coordinates, and XOR them. The result indicates whether the square is black or white.
int a = xCoordinate & 64;
int b = yCooridnate & 64;
int c = a ^ b; // ^ is the bitwise XOR operator
if(c == 0) color = black;
else color = white;
Just a note. This piece of code assumes you have a black square on coorinate (0 to 63, 0 to 63). If you have a white square there instead, just swap the two colors in the if-statement.