Hello Daniel,

Carsten Neumann wrote:
> daniel trindade wrote:
>> The height map i tried to load has a size of 1000 x 1000. The error 
>> occurs because calcD2Value tries to access v[1001000] when v has a size 
>> of 1000000. Is this a bug?
> 
> yes, it seems the index calculation has an off by one error if width is 
> even (which is pretty bad if you want to use power of two sized 
> heightmaps... ;) ). I'll take a look if I can fix it, I'm not very 
> familiar with the code, so this mostly depends on whether this mistake 
> is only in calcD2Value or if similar ones are all over the place.

hm, looking some more at this and the paper the algorithm is based on 
(http://wwwvis.informatik.uni-stuttgart.de/~roettger/data/Papers/TERRAIN.PDF), 
the implementation assumes that you have a heightmap of size 2^n+1 x 
2^n+1. The paper indicates that is not a hard requirement of the 
algorithm, but it seems the implementation is based on this restriction.

Can you try scaling your heightmap to e.g. 1025x1025 ?

        Cheers,
                Carsten



------------------------------------------------------------------------------

_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to