This tutorial will show you a quick and easy way of allowing your objects to spin/rotate automaticaly.
Firstly you need to either import or create your shape.
creating a plane:
private var object:Plane;...object = new Plane(...)
If you need a more detailed explanation of creating standard shapes, please visit this tutorial for more information.
Importing a .DAE:
public class Example extends BasicView { var dae:DAE; var daeFile:String; var daeMaterialName:String; public function Mainscale() { daeFile = "yourDAEfile.dae"; daeMaterialName = "YourTextureName"; dae = new DAE(); dae.load(daeFile); dae.scale = 120; scene.addChild(dae); } }
after you have imported and added your Object to the scene, you need to add a loop in the code (i.e an event listener) then call the function.
so stragiht after we have added the object to the scene i.e using scene.addChild(yourobjectName);
add an event listener:
addEventListener(Event.ENTER_FRAME, loop3D);
Then create a new function, that listens for the event:
private function loop3D(e:Event):void{ //either use yourobjectName.yaw(2); //changing the number will increase or decrease the speed //OR use yourobjectName.rotationY++}
And that should do it!
need any extra help? leave a comment, and i will get back to you!