Cage opened this issue on Dec 20, 2006 · 1232 posts
Spanki posted Mon, 08 January 2007 at 2:57 AM
[continued]...
I forgot to mention the screening code part... basically, I had written all of that up, with the idea that you'd have this big honkin, multi-dimensional lookup table (the vertWeightTable thing). But as I was writing the #3 part, it became clear that I'd organized the table wrong, making it difficult to scan through it, so I went back and added the stuff about just computing the information on-the-fly...
Instead of creating the table, if you just do your vertex correlation code at the spot in the code where you need to find the matching vertex (or vertices), it's less hassle figuring out how to store it and there's another benefit - screening. Since the selected morph(s) are driving the process anyway, you only really need to look around the morphed area for matching vertices.
With that knowledge in hand, you do a quick pre-processing step.. scan through the morph delta list once and come up with a min/max (in all 3 dimensions) world-space vertex values that defines the bounding box. Then add some fudge factor to that (to pick up stray vertices around the edges).
Now you have the only bounding box you need to look at and it's relevent to the task at hand (ie. it's perfectly centered around the morph area in question). You can then do further screening based on exclusion lists, or whatever.
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.