I want to store the byte value of aFloat in pixelsArray for each 3D coordinate, in a 1D array:
float aFloat = 1.0;
unsigned char* pixelsArray = new unsigned char[HEIGHT*WIDTH*3];
for (int i = 0; i < HEIGHT; i++)
{
for (int j = 0; j < WIDTH; j++)
{
for (int k = 0; k < 3; k++)
{
pixelsArray[?] = aFloat;
}
}
}
What would go in the ?? I think it also needs to have + sizeof(float)
somewhere in the index if I'm not mistaken.