PNX Format

Guides, Q&A, Suggestions

PNX Format

Postby flux » Sun 22. Feb 2015, 08:26

Here are the specs for the pnx format.

Code: Select all
int[3] - size of all voxels

int - count of layers

int - count of images (imageCount)
for (int i = 0; i < imageCount)
           int - image data length
           png - png image data

for (int i = 0; i < layerCount; i++)
            int - layer name length
            string - layer name (utf8)

            byte - layer visible flag

            byte - layer locked flag

            int[3] - size of this layer (size)
            int[3] - corner of the voxels in this layer (min)

            for (int x = size[0] + min[0] - 1; x > min[0] - 1; x--)
                int - imageId
                for (int y = 0; y < size[1]; y++)
                    for (int z = 0; z < size[2]; z++)
                        int rgb = img[imageId].getRGB(y, z);
                        if ((rgb >> 24) != 0x00) // check for transparency of the png pixel
                            addVoxel(x, y + min[1], z + min[2], rgb);
flux
Administrator
 
Posts: 250
Joined: Sun 20. Jun 2010, 00:31

Return to VoxelShop

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest

cron