[ODE] Proposal: Change Heightfield Origin

gcarlton@iinet.net.au gcarlton at iinet.net.au
Thu Jul 13 18:02:27 MST 2006


Quoting Martijn Buijs <buijs512 at planet.nl>:

> 
> When rendering a terrain, you usually start at [0,0] and loop through the
> vertices. Of course you 
> can offset those as well, but at its simplest, the origin lies at [0,0]. If
> we'd offset the origin 
> to the center, you need to take that in account in all your non ODE terrain
> calculations (quick 
> height tests for AI etc).
> 

I agree with this.  A heightfield is a grid of numbers, [0,0][N,N].  As such, if
I create a heightfield with no additional offset, I would expect the [0,0] point
to be exactly that, at the origin.  The outer extents are likewise at [kN,kN]
where k is the scaling factor involved - normally I would expect the heightfield
to be embedded in the 2d subset [kN,kN,0] but as Y-up won out, it is actually
[kN,0,kN].  Not too much worse, and nothing a rotation won't fix.  

Although now I think about it, does that mean the rotated z-up heightfield is
now [kN,-kN,d], or is it [kN,kN,-d] ?  Are there any problem with switching
(+X,+Z) with +Y up, to (+X,+Y) with +Z up?  Seems like its changing handedness..

Anyway, I'm not really in favour of an additional transform such that 
its in the range [-kN/2,-kN/2][kN/2,kN/2].

Geoff


More information about the ODE mailing list