Re: [Algorithms] more plane-poly clipping woes
Brought to you by:
vexxed72
From: Jamie F. <j.f...@re...> - 2000-09-22 08:48:41
|
[Snip] > Now if dm is very small, and w is very large (which are both > typical in games) then my distance dw is horribly inaccurate. We've had this problem with physics.... [Snip] > You can avoid these precision nightmares most of the time by > never going to world-space. That is, light in model space, render > using a direction model-to-view transform, etc. Also, collision > testing between two models should take one model to the space of > another, instead of taking them both into world space. > > Unfortunately, this problem cannot be avoided for whole-world > spatial structures like a BSP. You must take all your models into > world-space when you put their polys in the BSP, since the BSP must > all be in one common space. Is this really true? I would imagine it's the straight forward way to use the BSP. But couldn't you redefine your space at each node in the tree? So you'd have (as one path down the tree) planes P0, P1, P2, ..., Pn, defined as ( x0, y0, z0, d0 ), etc. At node i, use ( xi, yi, zi ) * di as your origin. You now have as much precision as you can get when deciding which side of the plane something is. You'd have lost precision along the way (just as you would have had you performed the calculation in world space), but you'll get more consistent decisions.... You could also define each plane in the BSP relative to its parent, which I think may increase the precision of the planes (although it won't help with the accuracy of objects which really are in world space). I've not spent too much thought on this, and it's still early in the morning... so, am I just spouting? Jamie Virus Scanned and cleared ok |