Volumes Of Fun http://www.volumesoffun.com/phpBB3/ |
|
How to get the nearest voxel from a 3d point ? http://www.volumesoffun.com/phpBB3/viewtopic.php?f=2&t=417 |
Page 1 of 1 |
Author: | Alex [ Sat Aug 11, 2012 1:18 pm ] |
Post subject: | How to get the nearest voxel from a 3d point ? |
Hello all ![]() I have a problem with PolyVox : How to get the nearest voxel position from a 3d point ? I want to remove voxel density in a symbolic sphere (for example: create a crater). To calculate which voxel to remove, I need to know the center of this sphere. I can get the center from the 3d environnement, but i must convert it to the volume position. Can someone help me ? ![]() Thx. |
Author: | Alex [ Sat Aug 11, 2012 6:52 pm ] |
Post subject: | Re: How to get the nearest voxel from a 3d point ? |
It seems to be the same coordinations... It will be easier so ![]() => resolved |
Author: | David Williams [ Sun Aug 12, 2012 10:12 am ] |
Post subject: | Re: How to get the nearest voxel from a 3d point ? |
Glad you solved it. Be aware that there is also an offset involved if you extract a region which does not correspond to the whole volume. I.e. if you have a volumeof dimensions 128x128x128 and you extract region (32,32,32) to (96, 96, 96) then a vertex with position (0,0,0) in the mesh actually corresponds to (32,32,32). Also, watch out for offsets of 0.5. The voxel is at the centre of a cube whereas the faces surround it and are not at integer positions. |
Author: | Alex [ Mon Aug 13, 2012 6:10 pm ] |
Post subject: | Re: How to get the nearest voxel from a 3d point ? |
Thx for this advice, i will pay attention about this ![]() |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |