Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Case Analysis of getting started with flash away3D

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

In this article, the editor introduces in detail the "case Analysis of getting started with flash away3D". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "case Analysis of getting started with flash away3D" can help you solve your doubts.

Step 1: download the away3d package from the official website

Step 2: configure the development environment. Place the downloaded source package away3D folder in a place you like, and then open flash

Cs6, select preference parameters under the Edit menu.

Select "ActionScript" in the preferences window.

In the pop-up "ActionScript 3.0"

Under the source path in the Advanced Settings window, select the browse button, select the away3D folder you just saved in the file selection window (parent folder is also OK), and confirm ok!

Step 3: create a new fla document and set the document class to main,main.as as follows:

Package

{

Import flash.display.MovieClip

Import flash.events.Event

Import flash.display.Stage

Import away3d.primitives.WireframeSphere

Import away3d.containers.View3D

Public class main extends MovieClip

{

Var view:View3D

Var ball:WireframeSphere

Public function main (): void

{

/ / set frame rate

Stage.frameRate=30

/ / create a viewport (if you are standing indoors and looking outside through a window, this viewport is equivalent to a window)

View=new View3D ()

/ / add viewports to the stage

AddChild (view)

/ / create a mesh sphere

Ball=new WireframeSphere (300, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,

/ / add a sphere to the scene in the viewport (scene is a world, and all objects seen through the viewport exist in the scene scene)

View.scene.addChild (ball)

/ / add an enterFrame listening event

AddEventListener (Event.ENTER_FRAME, onenterframe)

}

Private function onenterframe (e:Event): void

{

/ / rotate the sphere along the Y axis

Ball.rotationY++

/ / render viewports (with viewports, scenes, and objects in the scene, we need the last step of rendering so that we can have the final effect)

View.render ()

}

}

}

After reading this, the article "case Analysis of getting started with flash away3D" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report