带 Flex 的 Papervision 3D

发布于 2024-07-24 12:05:07 字数 89 浏览 3 评论 0原文

我是 Papervision 的新手。 我想设计一个球体,周围有 8 个孔 其直径。 我该怎么做? 如何在 Papervision 中的球体上绘制任何内容?

I am a newbie to Papervision. I want to design a sphere with 8 holes around one
of its diameters. How do I do it? How do I draw anything on a sphere in Papervision?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猫七 2024-07-31 12:05:07

取决于您想要孔的外观。 您可以在任何 3D 编辑器中制作一个带有孔的整体。 Blender、wings 3d、sketchup 都是免费的,并且可以以 papervision 支持的格式导出。

如果您想在球体上绘图,则意味着您想创建并应用纹理。 您可能想尝试使用凹凸贴图来获得一点真实感,但对于 npw,仅应用材质就是一个好的开始。

最简单的方法是应用位图或影片材质。 顾名思义,位图材质只是位图,而影片材质是由影片剪辑制作的材质。
据我所知,位图材质有 3 种类型:

BitmapMaterial - 您在其构造函数中传递 BitmapData 实例
BitmapFileMaterial - 将路径传递给外部图像文件
BitmapAssetMaterial - 您从库中传递位图的链接名称。

MovieMaterial 有 2 个版本:简单的 MovieMaterial,您在其构造函数和 MovieAssetMaterial 中传入对 DisplayObject 的引用。 您通过了 Linkage Class 集
对于库中的影片剪辑。 还有一个 MovieCacheMaterial,但我认为您不需要它。

所以这里是一个关于如何向球体添加纹理的基本示例,假设您的场景称为场景:

//assuming BMP8holes is a linkage for a Bitmap in the library
var ballBitmapMaterial:BitmapAssetMaterial = new BitmapAssetMaterial("BMP8holes");
//assuming Movie8holes is a linkage a MovieClip in the library
var ballMovieMaterial:MovieAssetMaterial = new MovieAssetMaterial("Movie8holes");

var ball:Sphere = new Sphere(ballBitmapMaterial);
scene.addChild(ball);

球体参考(无论如何……pv3d文档)在这里:http://papervision3d.googlecode.com/svn/trunk/ as3/trunk/docs/org/papervision3d/objects/primitives/Sphere.html

希望这有帮助。

Depends on how you want the holes to look like. You could just make a wholes with holes in it in any 3d editor. Blender and wings 3d , sketchup are free and can export in papervision supported formats.

If you want to draw on a sphere, it means you want to create and apply a texture. You might want to try using a BumpMap for a bit of realism, but for npw, just a applying a material is a good start.

The simplest way is to apply a Bitmap or MovieMaterial. A Bitmap Material is just a Bitmap, as the name implies and a MovieMaterial is a material made from a MovieClip.
There are 3 flavours of Bitmap materials as far as I know:

BitmapMaterial - you pass a BitmapData instance in it's constructor
BitmapFileMaterial - you pass the path to a an external image file
BitmapAssetMaterial - you pass the linkage name of a bitmap from the library.

MovieMaterial has 2 version: simple MovieMaterial, you pass in a reference to a DisplayObject in it's constructor and MovieAssetMaterial. You pass the Linkage Class set
for a MovieClip in the Library. There is also a MovieCacheMaterial, but I don't think you'll need it for this.

so here is a basic example on how you add a texture to a sphere, assuming your scene is called scene:

//assuming BMP8holes is a linkage for a Bitmap in the library
var ballBitmapMaterial:BitmapAssetMaterial = new BitmapAssetMaterial("BMP8holes");
//assuming Movie8holes is a linkage a MovieClip in the library
var ballMovieMaterial:MovieAssetMaterial = new MovieAssetMaterial("Movie8holes");

var ball:Sphere = new Sphere(ballBitmapMaterial);
scene.addChild(ball);

Sphere reference ( well...pv3d docs anyway) here: http://papervision3d.googlecode.com/svn/trunk/as3/trunk/docs/org/papervision3d/objects/primitives/Sphere.html

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文