flash on 2010-4-14
/**
* Copyright kihon ( http://wonderfl.net/user/kihon )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/Ydjn
*/
package
{
import flash.display.BitmapData;
import flash.events.Event;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.system.Security;
import org.papervision3d.materials.BitmapFileMaterial;
import org.papervision3d.objects.primitives.Cylinder;
import org.papervision3d.view.*;
[SWF(backgroundColor=0x0)]
public class Main extends BasicView
{
public function Main()
{
Security.loadPolicyFile("http://farm1.static.flickr.com/crossdomain.xml");
var material:BitmapFileMaterial = new BitmapFileMaterial("http://farm1.static.flickr.com/56/127849602_aef19d6095.jpg");
material.precise = true;
material.smooth = true;
var cylinder:Cylinder = new Cylinder(material);
cylinder.rotationY = -45;
scene.addChild(cylinder);
camera.y = 200;
camera.z = -200;
camera.lookAt(cylinder);
startRendering();
addEventListener
(
Event.ENTER_FRAME,
function():void
{
var bd:BitmapData = material.bitmap;
var copy:BitmapData = bd.clone();
bd.scroll(1, 0);
bd.copyPixels(copy, new Rectangle(bd.width - 1, 0, 1, bd.height), new Point());
}
);
}
}
}