It is currently Mon Dec 09, 2019 6:52 pm


All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to get the nearest voxel from a 3d point ?
PostPosted: Sat Aug 11, 2012 1:18 pm 

Joined: Tue Jul 24, 2012 1:02 pm
Posts: 11
Location: France
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.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: How to get the nearest voxel from a 3d point ?
PostPosted: Sat Aug 11, 2012 6:52 pm 

Joined: Tue Jul 24, 2012 1:02 pm
Posts: 11
Location: France
It seems to be the same coordinations... It will be easier so :D
=> resolved


Top
Offline Profile  
Reply with quote  
 Post subject: Re: How to get the nearest voxel from a 3d point ?
PostPosted: Sun Aug 12, 2012 10:12 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: How to get the nearest voxel from a 3d point ?
PostPosted: Mon Aug 13, 2012 6:10 pm 

Joined: Tue Jul 24, 2012 1:02 pm
Posts: 11
Location: France
Thx for this advice, i will pay attention about this ;)


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net