slanton Posted November 14, 2009 Share Posted November 14, 2009 I am using papervision3d and want to be able to rotate the camera at a constant speed for an indefinite time with the ability to stop and start. I am thinking that I will need to tween to something like camera.rotationY+20 and then constantly repeat the tween. Would this be the best way ? Link to comment Share on other sites More sharing options...
slanton Posted November 14, 2009 Author Share Posted November 14, 2009 and yet when I try something like TweenMax.to(camera, 10, {rotationY:360,repeat:-1}); I get the following error message when I try to run it " Property repeat not found on org.papervision3d.cameras" Link to comment Share on other sites More sharing options...
TronicVolta Posted November 14, 2009 Share Posted November 14, 2009 Are you using the most recent tween classes, because it works for me? package { import org.papervision3d.view.BasicView; import org.papervision3d.objects.primitives.Plane; import org.papervision3d.materials.ColorMaterial; import com.greensock.easing.Linear; import com.greensock.TweenMax; public class Main extends BasicView { public function Main() { super(0, 0, true, false, "FreeCamera"); scene.addChild(new Plane(new ColorMaterial(0x990000))); startRendering(); TweenMax.to(camera, 10, { rotationY:360, repeat:-1, ease:Linear.easeNone} ); } } } Link to comment Share on other sites More sharing options...
slanton Posted November 14, 2009 Author Share Posted November 14, 2009 Yes that was the problem. Thanks for that. Link to comment Share on other sites More sharing options...
slanton Posted November 14, 2009 Author Share Posted November 14, 2009 Because I want to be able to rotate forwards and backwards at a constant speed I did this public function rotateForward():void { var timeint:int=Math.abs(360-camera.rotationY)/8; TweenMax.to(camera, timeint, { rotationY:360, repeat:-1, ease:Linear.easeNone}); } public function rotateBack():void { var timeint:int=Math.abs(-360-camera.rotationY)/8; TweenMax.to(camera, timeint, { rotationY:-360, repeat:-1, ease:Linear.easeNone}); } public function stop():void { TweenMax.to(camera, 0, {rotationY:camera.rotationY}); } but I see that tweenMax has reverse() restart() built in so may try and use those methods Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now