Horde3D
http://horde3d.org/forums/

bug in calcCropMatrix?
http://horde3d.org/forums/viewtopic.php?f=3&t=1466
Page 1 of 1

Author:  Rauy [ 19.03.2011, 15:35 ]
Post subject:  bug in calcCropMatrix?

I just read over calcCropMatrix and although I have not completely thought about its working, I find the following lines a bit irregular:

Code:
float minX = clamp( maxf( frustMinX, bbMinX ), -1, 1 );
float minY = clamp( maxf( frustMinY, bbMinY ), -1, 1 );
float minZ = clamp( minf( frustMinZ, bbMinZ ), -1, 1 );   <--- !!!
float maxX = clamp( minf( frustMaxX, bbMaxX ), -1, 1 );
float maxY = clamp( minf( frustMaxY, bbMaxY ), -1, 1 );
float maxZ = clamp( minf( frustMaxZ, bbMaxZ ), -1, 1 );


If this is right, forgive my stupid post, but it seems a bit irregular, that you use min for the z coordinate and max for the others.

Author:  marciano [ 19.03.2011, 21:10 ]
Post subject:  Re: bug in calcCropMatrix?

I agree that it looks irregular but it is really intended in that case to improve the depth precision (please see also this article for more details). A comment in the code would certainly be useful...

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/