It is currently Fri Nov 15, 2019 8:20 am


All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [Resolved] Extracted Mesh's origin is LowerCorner of region
PostPosted: Sun Feb 12, 2012 3:00 am 

Joined: Wed Jan 25, 2012 12:29 am
Posts: 18
Don't know if this is actually a bug or a feature ;)

When I extracted a part of the volume using the cubicSurfaceExtractor with a region that isn't the volume.getEnclosingRegion() the vertices generated are actually offsets from the LowerCorner of the region rather than being in the volume's coordinate system.

I'm fine with this behaviour; it seems like a reasonable thing to do but it would be good for it to be documented.

Cheers,
Charlie


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Extracted Mesh's origin is LowerCorner of region
PostPosted: Sun Feb 12, 2012 2:58 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Yep, this is the expected behaviour (though it probably should be documented). The reason is that floating point numbers have less precision as they get bigger, and this can be a problem with large terrains when you are far from the origin. At least, in theory it can be a problem.

By returning local coordinates this problem is at least moved outside of PolyVox, though you may need to be aware of it in your other code. The integer offset doesn't suffer from precision issues. You can also retieve the offset from the mesh via something like 'myMesh.m_Region.getLowerCorner()'.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Extracted Mesh's origin is LowerCorner of region
PostPosted: Sun Feb 12, 2012 8:52 pm 

Joined: Wed Jan 25, 2012 12:29 am
Posts: 18
Makes perfect sense. Now if I can just remember this and stop re-discovering it ;)


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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