I'm trying to add kv6 support to my voxel editor, already got kv6 importing figured out but I'm stuck trying to figure out how to generate the normalindex byte from a float normal vector. Is there any simple (slow is OK) formula for that?
Edit: A dump of the table would do the job as well.
Thanks
Edited by Atomic at
Awesoken at
Re: Normal table
In SLAB6.C, search for "equivec". These functions handle the conversion between (x,y,z) and 8-bit normal index. If you just want the list of normals, look at equiind2vec(). The constants, equivec.zmulk and equivec.zaddk, are calculated at the top of equivecinit(), where n is always passed as 255. Good luck.
Atomic at
Thanks a lot, the equiind2vec() formula did it! I've included credits to you for the vox/kv6 formats on the next version's readme.