简体   繁体   English

away3d-1个平面上有2个纹理

[英]away3d - 2 textures on 1 plane

Im trying to make plane with full (background) texture and partial (element) texture on 1 plane. 我试图在1个平面上制作具有完整(背景)纹理和部分(元素)纹理的平面。 Partial element will change often in runtime , so Im curious if can use kind of double drawing on single plane element ? 部分元素在运行时会经常变化,所以我很好奇是否可以在单个平面元素上使用双重绘制?

Is is possible ? 有可能吗? Or I have to make 2 planes , one above another ? 还是我必须制造两架飞机,一架在另一架上?

A simple solution would be to extend BitmapTexture and create a class similar to WebcamTexture where you composite the images and assign the results to the texture's bitmapdata. 一个简单的解决方案是扩展BitmapTexture并创建一个类似于WebcamTexture的类,在其中您可以合成图像并将结果分配给纹理的位图数据。

Look at the update function in the WebcamTexure class , that's where they grab the camera bitmapdata and apply it to the texture. 查看WebcamTexure类中的update函数,在那里他们将获取相机位图数据并将其应用于纹理。

If autoUpdate is true the update() function is called from uploadContent(), similar to OnEnterFrame. 如果autoUpdate为true,则类似于OnEnterFrame,从uploadContent()调用update()函数。 To manually update the texture set autoUpdate to false and call update() only when needed. 要手动更新纹理,请将autoUpdate设置为false并仅在需要时调用update()。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM