[Papervision3D] Smooth Camera Move

Stoleru Andrei andrei.stoleru at gmail.com
Sat Oct 27 14:50:21 PDT 2007


hi
that depends on your container.mouseX and container.mouseY
on www.rossino.it/preview
I also use a TweenLite.to(conatiner,1,{scale: ...x:stage.stageWidth/2...
which hold the container in the center of the screen and at a certain  
scale

On Oct 27, 2007, at 5:48 PM, grapefruitlips wrote:

> I want my object to be always visible in the scene
> my function and your with Tweenline does smooth the camera,
> but it will never stop and my object will *fly away* soon if i move  
> the mouse to the corner of the screen (for example)
> So i want it to be just like here:
> http://www.airtightinteractive.com/projects/tiltviewer/app/
>
> where your mouse move rotates the camera, but the object doesn't fly  
> away
>
>
>
>
>
> Stoleru Andrei wrote:
>>
>> Well
>> Why don't you try using some form of tween (like TweenLite)
>>
>> and try something like this
>>
>> import gs.TweenLite;
>>
>> //add event listener
>>  this.addEventListener(Event.ENTER_FRAME,render);
>> // move the camera and render the scene
>> function render(evt:Event):void {
>>  TweenLite.to(camera,1, 
>> {x:container.mouseX,y:container.mouseY,overwrite:true});
>>  scene.renderCamera(camera);
>> }
>>
>> On Oct 27, 2007, at 4:28 PM, grapefruitlips wrote:
>>
>>> Hi
>>> I'm trying to figure out how to smooth and then stop the camera move
>>> when a user stops moving the mouse.
>>> i want my object (plane with picture bitmap) to be always visible  
>>> in the scene
>>> right now it will be moving forever:
>>>
>>>         function loop(e:Event):void
>>>         {
>>>
>>>           camera.x +=((container.mouseX*50) - camera.x) * 0.002;
>>>           camera.y +=((-container.mouseY*50) - camera.y) * 0.002;
>>>
>>>           scene.renderCamera( this.camera );
>>>
>>>          }
>>>
>>> the + is the thing to smooth the move i guess
>>> but how can i stop it when user stops moving the mouse?
>>> help me out please
>>>
>>> btw, here is the right example what i want my camera to be like:
>>> http://www.airtightinteractive.com/projects/tiltviewer/app/
>>> _______________________________________________
>>> Papervision3D mailing list
>>> Papervision3D at osflash.org
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20071027/aa3473e5/attachment-0001.html 


More information about the Papervision3D mailing list