Re: [Algorithms] Stripping scaling out of a hierarchy.
Brought to you by:
vexxed72
From: <lei...@co...> - 2009-12-19 02:06:51
|
Thanks Jon. Its a j2me game with very limited resources so I am not supporting anything I don't need. I realize that a matrix mul is a mul whether there is a scaling in it or not so there isn't really a performance issue for rendering. It's more for the game logic where I am using basis vectors for direction or determining distance between parts. Also I hate debugging data that requires me to remember everything is scaled for no good reason. As it turns out XSI's freeze scaling leaves all the pivot points unchanged so it's of limited use. For now I am going to fix up the pivot points inside of XSI since the project is small enough. I will cut and paste your suggestion into my build to since I do want to get it going correct at some point. Thanks again! Leigh Jon Watte wrote: > First: Why don't you make your runtime support scaling? > > Second: If you can't do that, then what you said you were doing would > be the right thing to do, assuming you implement it correctly. For the > hierarchy: > > Remove scale from the node transform (times parent extracted scale) > Bake scale into any attached geometry > foreach child: > do the same, passing along any scale you've extracted > > Extracting scale from a matrix is easy as long as there is no skew or > rotated scale center; simply measure the length of each of the basis > vectors (X, Y, Z) and normalize to 1. No full decomposition needed. > > Sincerely, > > jw > > > -- > Americans might object: there is no way we would sacrifice our living > standards for the benefit of people in the rest of the world. > Nevertheless, whether we get there willingly or not, we shall soon > have lower consumption rates, because our present rates are > unsustainable. > > > > On Fri, Dec 18, 2009 at 3:11 PM, lei...@co... > <mailto:lei...@co...> <lei...@co... > <mailto:lei...@co...>> wrote: > > Hello everyone. > > My XSI exporter supports exporting a small hierarchy of objects. One > of it's uses is to allow the game to find parts like the tracks, body, > wheel, turret etc. All works fine until I purchased some models that > are the wrong scale and I decide to scale them in XSI to 1 unit is 1m. > Now my hierarchy has scaling in it. This becomes a mess with bounding > volumes on parts and frame of references having scaling in it. I > finally found an option in XSI to freeze all the scaling but I was > wondering how can I have my build tool do the same thing so that I > won't > have problems down the road? Also its bugging me. > > I tried resolving all the nodes into model space and then using > inverse > transforms to resolve the local transforms on each part. It > didn't work. > > Leigh > > > > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution > fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > <mailto:GDA...@li...> > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > ------------------------------------------------------------------------ > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list |