Away3D (4.x Broomstick) - 如何设置加载 3DS 文件的材质的 Alpha?
我已经使用 3DS 解析器加载了一个模型,该解析器已经链接到材质并且加载良好。我想让这个模型在部分时间但不是所有时间都是半透明的。我想只设置 alpha = .5,但是当我瞄准材料时,这不是一个选项。
这是代码和使用:
var slingPar:Max3DSParser = new Max3DSParser();
var slingLoader:Loader3D = new Loader3D();
sling = new ObjectContainer3D();
slingLoader.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function(e:LoaderEvent):void
{
var mesh:Mesh = Mesh(sling.getChildAt(0));
mesh.material.lights = [light1, light2, light3];
mesh.rotationY = 180;
});
slingLoader.load(new URLRequest("assets/game/slingCup.3DS"),slingPar);
sling = slingLoader;
我尝试过
mesh.material.alpha = .5
但没有运气。有什么想法吗?
I have loaded a model using the 3DS parser that is already linked to a material and loads fine. I would like to make this model semi-transparent part of the time but not all of the time. I would like to just set alpha = .5 but when I target the materal that is not an option.
Here is the code and using:
var slingPar:Max3DSParser = new Max3DSParser();
var slingLoader:Loader3D = new Loader3D();
sling = new ObjectContainer3D();
slingLoader.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function(e:LoaderEvent):void
{
var mesh:Mesh = Mesh(sling.getChildAt(0));
mesh.material.lights = [light1, light2, light3];
mesh.rotationY = 180;
});
slingLoader.load(new URLRequest("assets/game/slingCup.3DS"),slingPar);
sling = slingLoader;
I tried
mesh.material.alpha = .5
But had no luck. Any Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想通了。我瞄准了加载网格的 BitmapMaterial 并从那里进行了修改。
I figured it out. I targeted the BitmapMaterial of the loaded mesh and modified from there.
尝试一下:
Try it: