[Papervision3D] Tweener and render camera

Zeh Fernando zehfernando at zeh.com.br
Thu Jun 14 21:24:45 EDT 2007


Hey Randy,

> I have just started using tweener and I think it is great for papervision
> but I have some questions. I noticed from the examples that the
>  scene.renderCamera( camera );
> Method is called in an onEnterFrame event while tweener is working
> independently of the frame rate. This has given me choppy results. How are
> those of you who are using tweener or tweenlite handling the
> scene.renderCamera( camera );
> Method?

Well, Tweener actually works *on* the framerate of the movie; it syncs 
its updates with the movie framerate so usually it should work with no 
hassle. On the examples I've built using Tweener and PV3D (available at 
Tweener's SVN or http://tweener.googlecode.com/svn/trunk/examples/) I've 
done nothing other than just tween stuff and have this same 
"scene.renderCamera(camera);" line running on an ENTER_FRAME event.

HOWEVER! AS3 allows you to have different framerates on specific 
movieclips/sprites. If you have your PV3D container on a sprite with a 
different framerate, things will go out of sync and it could potentially 
look odd.

I'm not sure if that's your case. If it is, I'd recommend you using the 
default framerate on your 3d container movie (or whereher it is that 
you're attaching your ENTER_FRAME event to), or you could sync the 
updates by doing something like this:

Tweener.addTween(myCamera, {x:10, time:1, onUpdate:scene.renderCamera, 
onUpdateParams:[camera]});

Something like this *should* work, although working with a fixed 
framerate is usually your best idea. There are reasons for custom 
framerates, but I believe such cases are rare.

As a side note, in the future Tweener will exploit this custom framerate 
feature by way of a custom "fps:" parameter, but right now that's on 
hold waiting for other features to be finished.


Zeh



More information about the Papervision3D mailing list