FLASH3D Study 1

Source: Internet
Author: User

Learn Flash3d today.

Configure first:


This is configured well.

The next one is the first flash3d.

Import Flash.display.movieclip;import Flash.events.event;import Flash.display.stage;import Away3d.primitives.wireframesphere;import Away3d.containers.view3d;var View:view3d;var Ball:WireframeSphere;main () function Main (): void{//set frame rate stage.framerate=30;//Create a viewport (if you are standing indoors through a window to look outdoors, this viewport is equivalent to a window) view=new view3d ();// Add a viewport to the stage addchild (view);//Create a mesh sphere ball= new Wireframesphere (300,10,10,0xff0000,1);//Add a sphere to the scene of the viewport (scene is a world, Objects seen through the viewport are view.scene.addChild (ball),//trace (ball.x);//Add a Enterframe listener event AddEventListener ( Event.enter_frame, onenterframe);} function Onenterframe (e:event): void{//Rotates the sphere along the y-axis 550+275=825,ball.rotationy++;ball.rotationz++;ball.x+=5;if (ball.x >975) ball.x=-700;//render viewports (with viewports, scenes, and objects in the scene, we also need a final step to render, so we can end up with the effect) View.render ();}
The original is written in the class, I used to write on the frame. It changed, and by the way a moving effect.

Original: http://blog.sina.com.cn/s/blog_4532d8b50101ata2.html

Attached to me: http://download.csdn.net/detail/jianqiu000/8901397

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

FLASH3D Study 1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.