madebycliff / as3dmod

Automatically exported from code.google.com/p/as3dmod
0 stars 0 forks source link

Bloat center is never used #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Need to update Bloat.apply() function as below, but it's actually better for GC 
to modify the Vertex3 methods to 
operate on the object instead of returning a new one.

        public function apply():void {
            var vs:Array = mod.getVertices();

            for each (var v:VertexProxy in vs) {

                // get a vector towards vertex
                _u.x = v.x; _u.y = v.y; _u.z = v.z;
                //_u.subtract ( _center );
                _u = _u.subtract (_center);

                // change norm to norm + r * exp (-a * norm)
                _u.magnitude += _r * Math.exp ( - _u.magnitude * _a);

                // move vertex accordingly
                //_u.add ( _center );
                _u = _u.add (_center);
                v.x = _u.x; v.y = _u.y; v.z = _u.z;
            }
        }

Original issue reported on code.google.com by C4RL054...@gmail.com on 28 Apr 2009 at 6:19

GoogleCodeExporter commented 9 years ago
It's been over a year, and I have never seen it until now :( Is this saying 
Bloat doesn't work in pv3d?

Original comment by makc.the...@gmail.com on 14 Jul 2010 at 3:16

GoogleCodeExporter commented 9 years ago
Bloat "works" but only at the default center. The supplied changes from 
C4RL05432 fix Bloat but create two extra Vector3 objects for each vertex at 
every application of the modifier. 

Original comment by goo...@mizerai.com on 21 Dec 2010 at 3:20

GoogleCodeExporter commented 9 years ago
Ah, I see. In rev 24 _u.subtract() actually modified _u, see 
http://code.google.com/p/as3dmod/source/browse/trunk/src/com/as3dmod/core/Vector
3D.as?r=24 I don't know why Bartek changed that in 
http://code.google.com/p/as3dmod/source/browse/trunk/src/com/as3dmod/core/Vector
3.as

Original comment by makc.the...@gmail.com on 22 Dec 2010 at 3:01

GoogleCodeExporter commented 9 years ago
I believe http://code.google.com/p/as3dmod/source/detail?r=103 should fix it.

Original comment by makc.the...@gmail.com on 22 Dec 2010 at 3:08