Nice, works well, got me a repeating texture and animated. I've not heard of the AGAL thing, I just done a quick google on it, but I think I'm going to need some examples or docs regarding what it's all about and how to use it.
I am attempting to re-construct this in Broomstick: http://www.allforthecode.co.uk/splash/high/ and then add to it. I did try regular poly for the floor like I used in 3.6 but the texture ends up radial. So I'm hoping a plane which is bigger than an outer sphere's diameter will nicely clip the places to form a circular floor in the center of the sphere where the floor will move via your incrementUV function. Testing testing testing... Cheers for those two functions very handy :) D On 12 April 2011 13:17, John Brookes <jbp...@googlemail.com> wrote: > I would guess its better done though that AGAL thang but. > > I was playing about with shifting the UVs other day didnt do rotation. > > Make sure the bitmapmaterial has tile set to true. > > private function incrementUV(m:Mesh, pos:Point):void > { > var v:Vector.<Number> = > SubGeometry(m.geometry.subGeometries[0]).UVData; > for (var i:int = 0; i < v.length; i=i+2) > { > v[i] += pos.x; > v[i + 1] += pos.y; > SubGeometry(m.geometry.subGeometries[0]).updateUVData(v); > } > } > > private function scaleUV(m:Mesh, pos:Point):void > { > var v:Vector.<Number> = > SubGeometry(m.geometry.subGeometries[0]).UVData; > for (var i:int = 0; i < v.length; i=i+2) > { > v[i] += ( pos.x - 1) * 0.5; > v[i + 1] += (pos.y - 1) * 0.5; > > v[i] /= pos.x > v[i + 1] /= pos.y; > > SubGeometry(m.geometry.subGeometries[0]).updateUVData(v); > } > } > > eg > incrementUV(plane, new Point(0.01, 0.01)); > scaleUV(plane, new Point(0.99, 0.99)); > > > No idea how safe/good. > was just playing about :) > >