Wow this is amazing stuff :) On Wed, Nov 17, 2010 at 8:56 AM, Darcey Lloyd <[email protected]>wrote:
> HoverCamera3D full source and example for download: > > > http://www.allforthecode.co.uk/aftc/forum/user/modules/forum/article.php?index=4&subindex=2&aid=101 > > 2 more examples of HoverCamera3D in use: > > http://www.allforthecode.co.uk/aftc/forum/user/modules/forum/article.php?index=4&subindex=4&aid=121 > > > http://www.allforthecode.co.uk/aftc/forum/user/modules/forum/article.php?index=4&subindex=5&aid=196 > > > D > > > > > > On 17 November 2010 13:40, George Profenza <[email protected]> wrote: > >> I was looking at Rob's Normal Mapping Demo(http:// >> >> www.infiniteturtles.co.uk/projects/away3d/demos/normalmap/Away3DNormalMapping.html >> ) >> and I like the camera movement. >> >> I would like to use it in my current project, but I've noticed the >> HoverCamera3D >> class got refactored, targetpanangle and targettiltangle are >> missing...are they replaced >> by maxPanAngle,maxTitleAngle ? >> >> How would I had Rob's setup: >> >> [code] >> private var lastPanAngle:Number; >> private var lastTiltAngle:Number; >> private var lastMouseX:Number; >> private var lastMouseY:Number; >> >> camera = new HoverCamera3D({zoom:3, focus:200, distance:40000}); >> camera.targetpanangle = camera.panangle = -10; >> camera.targettiltangle = camera.tiltangle = 20; >> camera.yfactor = 1; >> >> private function initListeners():void >> { >> addEventListener( Event.ENTER_FRAME, onEnterFrame ); >> stage.addEventListener(MouseEvent.MOUSE_DOWN, >> onMouseDown); >> stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp); >> } >> >> private function onEnterFrame(event:Event):void >> { >> if (move) { >> camera.targetpanangle = 0.3*(stage.mouseX - >> lastMouseX) + lastPanAngle; >> camera.targettiltangle = 0.3*(stage.mouseY - >> lastMouseY) + lastTiltAngle; >> } >> camera.hover(); >> >> } >> >> private function onMouseDown(event:MouseEvent):void >> { >> lastPanAngle = camera.targetpanangle; >> lastTiltAngle = camera.targettiltangle; >> lastMouseX = stage.mouseX; >> lastMouseY = stage.mouseY; >> move = true; >> >> } >> private function onMouseUp(event:MouseEvent):void >> { >> move = false; >> >> } >> >> [/code] >> >> How would I write that for the current version of Away3D ? > > >
