Fit off-by-one error in resampler by using available functions
It still doesn't work as expected but this is a step in the right direction.
This commit is contained in:
parent
3577a56eb3
commit
88c8c4014a
@ -81,13 +81,13 @@ namespace PolyVox
|
|||||||
template< typename SrcVolumeType, typename DstVolumeType>
|
template< typename SrcVolumeType, typename DstVolumeType>
|
||||||
void VolumeResampler<SrcVolumeType, DstVolumeType>::resampleArbitrary()
|
void VolumeResampler<SrcVolumeType, DstVolumeType>::resampleArbitrary()
|
||||||
{
|
{
|
||||||
float srcWidth = m_regSrc.getUpperCorner().getX() - m_regSrc.getLowerCorner().getX();
|
float srcWidth = m_regSrc.getWidthInVoxels();
|
||||||
float srcHeight = m_regSrc.getUpperCorner().getY() - m_regSrc.getLowerCorner().getY();
|
float srcHeight = m_regSrc.getHeightInVoxels();
|
||||||
float srcDepth = m_regSrc.getUpperCorner().getZ() - m_regSrc.getLowerCorner().getZ();
|
float srcDepth = m_regSrc.getDepthInVoxels();
|
||||||
|
|
||||||
float dstWidth = m_regDst.getUpperCorner().getX() - m_regDst.getLowerCorner().getX();
|
float dstWidth = m_regDst.getWidthInVoxels();
|
||||||
float dstHeight = m_regDst.getUpperCorner().getY() - m_regDst.getLowerCorner().getY();
|
float dstHeight = m_regDst.getHeightInVoxels();
|
||||||
float dstDepth = m_regDst.getUpperCorner().getZ() - m_regDst.getLowerCorner().getZ();
|
float dstDepth = m_regDst.getDepthInVoxels();
|
||||||
|
|
||||||
float fScaleX = srcWidth / dstWidth;
|
float fScaleX = srcWidth / dstWidth;
|
||||||
float fScaleY = srcHeight / dstHeight;
|
float fScaleY = srcHeight / dstHeight;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user