Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

[Resolved] Extracted Mesh's origin is LowerCorner of region
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=15&t=331
Page 1 of 1

Author:  charlieb [ Sun Feb 12, 2012 3:00 am ]
Post subject:  [Resolved] Extracted Mesh's origin is LowerCorner of region

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

Author:  David Williams [ Sun Feb 12, 2012 2:58 pm ]
Post subject:  Re: Extracted Mesh's origin is LowerCorner of region

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()'.

Author:  charlieb [ Sun Feb 12, 2012 8:52 pm ]
Post subject:  Re: Extracted Mesh's origin is LowerCorner of region

Makes perfect sense. Now if I can just remember this and stop re-discovering it ;)

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/