Hai, i want to ask how to make Up and Down function?
This tutorial can make move left and right (This is Source Code)
Anyone can help me find out for this solution?
Thanks a lot
Using A Skybox with Up and Down FunctionSoftware: Away3D 4.x |
||
Selly, Newbie
Posted: 25 November 2014 06:20 AM Total Posts: 3 |
||
GrokDD, Newbie
Posted: 26 November 2014 08:52 AM Total Posts: 28 [ # 1 ] Yeah, all the magic is in the onEnterFrame function.
private function _onEnterFrame(e:Event):void They set the camera back at the origin (0,0,0) of the 3D universe. Then rotate the camera a calculated amount depending on the X position of the cursor on the screen. Finally moving the camera “back” a designated distance. It all happens before the frame is seen on screen. So to answer your question, try adding the line:
_view.camera.rotationX += 0.5*(stage.mouseY-stage.stageHeight/2)/800;
I wrote a tutorial explaining what is happening here. |
||
|
||
|