Below is a code, which sometimes randomly says error, unhandled exception error something to do with access mask out of bond which is ridiculous and sometimes it works, i don't know why
projected points is between between 0 and 480 for x and 0 and 640 for y and mask size is 480x640.
threedimension is a 3D array size 30x30x30, which the value of each location is either a 1 or a 0 and threedpoint contain the 3d coordinates, which is used as a lookup to threedimension array
i thought i mentioned it, ok never mind, here it is.
threedpoint contains 60x60x60 elements 216000 i think
threedimension is a 3D array containing 1s in all elements.
vertexpoints elements varies, as it depends on wether the 3d location at threedimension contains a value 1 if not it is not added to vertex points.
else it is.
it is cleared everytime to add new values which do contains ones in the 3d array threedimension.