Cage opened this issue on Dec 20, 2006 · 1232 posts
Spanki posted Sun, 14 January 2007 at 3:34 AM
Ok, I think I understand that now and you appear to have it correct. I think the remaining hitch is non-planar polygons (or at least the potential for them). They will throw off the poly face normals which probably also affects the ray->plane intersection code.
Fixing that means switching to a triangular representation of the mesh we're testing against. Ramifications are:
for all intents and purposes, a doubling of the polyons (the majority of Poser mesh polygons are quads). So this means...
Larger storage requirements ( ultimately edges, pnorms, pplanes and pregs - but some others while building those up ).
A doubling of polys to test against means a longer time to test for hits (until a hit is found, so maybe slightly less than double the time, on average).
The current region material setting will have to be re-thought, or abandoned (no big deal).
It moves us a step closer to implementing the vertex weighting.
...currently, we're still getting a few misses in some cases, but as far as I can tell the regions are being set up well enough and the rays being cast are now going the right directions. It's possible that there's still some line-intersection problem in the check_bounds() code, but the only other thing I can think of at this point is warped polygons throwing off one or more of the calculations.
If you want to look into triangulating the polygons, I'll spend some more time looking into the line intersection issue in check_bounds().
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.