开发者

How do I create 3D cylinder, sphere and cone using Actionscript 3 (Flash 10)?

开发者 https://www.devze.com 2023-01-28 07:34 出处:网络
I want to create a 3D cylinder, sphere, cone using Actionscript for Flash Player 10开发者_高级运维. Is there any available class?

I want to create a 3D cylinder, sphere, cone using Actionscript for Flash Player 10开发者_高级运维. Is there any available class? I also want to know how to paint gradient, wrap text and texture around them. It would be nice if these class have these functions. I can't use non DisplayObject in this project so PV3D is not an option


As Cameron says, you should probably use a framework like PV3D or Away3D. That said, all those frameworks are written in AS so you could roll your own.

Here are a few examples I created using only the fp10 3d engine:

http://actionsnippet.com/?p=1726

http://actionsnippet.com/?p=2092

http://actionsnippet.com/?p=2097

http://actionsnippet.com/?p=2158

You can create primative shapes using parametric equations:

sphere :

x = r sin(u) cos(v)
y = r cos(u) cos(v)
z = r sin(v)

For a cylinder you can just use the equation for a circle and extrude it:

x = r cos(t)
y = r sin(t)
z = increase at some interval to the height of the cylinder

I can post some additional information about this topic if your interested.


There are 3D drawing functions for Flash 10, but I don't think they support wrapping text around a 3D object. It sounds like you need a 3D framework. Some popular ones (there's lots):

  • Sandy3D
  • Papervision3D
  • Away3D

Keep mind that Adobe has announced that it will soon be releasing a new version of Flash with built-in hardware-accelerated 3D rendering APIs (codenamed "molehill").

0

精彩评论

暂无评论...
验证码 换一张
取 消