[ODE] Re: Heightfield / Collision.
Erwin de Vries
erwin at vo.com
Tue Feb 18 06:08:01 2003
Although i havent thought about this much, imo the best way would be to let
the user define a sampling callback which returns a height. Something like
this:
dReal HeightSample(dReal x, dReal z);
You can do this 3 times and create an approximate triangle from it. Then you
just do the collisions with this single triangle, which is a reasonable
approximation i guess.
Erwin
----- Original Message -----
From: <skjold@cistron.nl>
To: <ode@q12.org>
Sent: Tuesday, February 18, 2003 13:32
Subject: Re: [ODE] Re: Heightfield / Collision.
> Actually, on a side note, I'm wondering if it's really desirable to use
triangles for collisions when it comes to heightfields. Like you illustrate
below, the same heightfield can be drawn using triangles in several ways,
but it all boils down to drawing an approximation much like the way you do
with spheres and cylinders, which you usually smooth out with some shading
technique (e.g. goroud).
>
> The actual heightfield is a 'sampling' at some resolution, that represents
a smooth, unfaceted terrain. Isn't it possible to test for intersections
against some form of interpolation function (e.g. bilinear or bicubic),
instead of triangles? Wouldn't colliding against a relief made of triangles
cause unexpected bouncing behaviour that awkwardly gives away this
granularity?
>
> I don't know much about collision detection, really. I was just wondering.
> Greets,
> Mark
>
>
> >
> > Another complication - heightfield triangle layout. I use
> > | \ | \ | \ |
> > | \ | \ | \ |
> >
> > Is anyone else using
> > | / | / | / |,
> > | / | / | / |,
> >
> > or
> > | \ | / | \ |
> > | / | \ | / |
> >
> > (ie. diamonds)? If yes, can you change or are you stuck with it?
> > --
> > gl
> >
> > ----- Original Message -----
> > From: "gl" <gl@ntlworld.com>
> > To: "Amund Børsand" <amund@c2i.net>
> > Cc: <ode@q12.org>
> > Sent: Tuesday, February 18, 2003 10:38 AM
> > Subject: Re: [ODE] Re: Heightfield / Collision.
> >
> >
> > >
> > > (here we go again) Was this a personal reply?
> > >
> > > Either way, back to the list we go.
> > >
> > > I wasn't suggesting arbitrary vertex spacing, as we're working on a
> > > regularly spaced heightfield collider and want to take advantage of
the
> > > optimisations you can make with them - rather, I was wondering if
anyone
> > > needs different x spacing to y spacing, ie. vertices that are
regularly
> > > spaced, but with different (fixed) spacings for each dimension?
> > >
> > > And/or if anybody needs non-square heightfields (ie. different quad
counts
> > > per dimension)?
> > > --
> > > gl
> > >
> > >
> > > ----- Original Message -----
> > > From: "Amund Børsand" <amund@c2i.net>
> > > To: "gl" <gl@ntlworld.com>
> > > Sent: Tuesday, February 18, 2003 9:14 AM
> > > Subject: Re: [ODE] Re: Heightfield / Collision.
> > >
> > >
> > > "gl" <gl@ntlworld.com> skreiv:
> > >
> > > >
> > > > Another thing - does anyone have any need for non-square
heightfields,
> > or
> > > > heightfields with different x/y vertex spacings?
> > >
> > > Yeah, I guess that would be nice, for instance in a car simulator,
where
> > > you don't have to waste lots of polygons/whatever you use to draw
> > > terrain on stuff outside the road, but the road/track could be very
> > > dense and detailed. On the other hand, using polygons drawn from a
> > > heightmap,
> > > with constant x and y spacing, you could probably make some really
fast
> > > interpolations between vertices, eliminating the need for
tri-collision
> > > detection. You could probably also make the terrain seem smoother to
> > > whoever's travelling on it, instead of flat and edgy as a polymesh
would
> > > be (though it would still _look_ flat and edgy.. unless you're clever
> > > with lightning maps or gouraud shading or something). But, ultimately,
> > > the coolest thing would of course to make this work with an irregular
> > > (x- and y-wise) polymesh/heightmap or something. Or, you could make a
> > > mesh from a heightmap, optimize it by removing vertices and polygons
> > > that make little difference to the look of the terrain, and then use
the
> > > heightmap for collision detection and stuff. If you get my drift.
> > >
> > > Hm. Good ideas, man, I think I'll have to implement this myself. =)
Let
> > > me know if you get it to work, and I'll do the same.
> > >
> > >
> > >
> > > _______________________________________________
> > > ODE mailing list
> > > ODE@q12.org
> > > http://q12.org/mailman/listinfo/ode
> > >
> >
> > _______________________________________________
> > ODE mailing list
> > ODE@q12.org
> > http://q12.org/mailman/listinfo/ode
> >
>
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode
>
>
>