2013-08-20 53 views
4

我无法获得BitmapTexture平铺,或作为另一个选项,让它拉伸。在两种情况下,目标是覆盖网状....平铺和拉伸3 3

例如,材料和气缸都是这样创建的(假设preExistingBitmapData是一个有效的BitmapData):

poleMaterial = new TextureMaterial(new BitmapTexture(preExistingBitmapData),true, true); 
poleMaterial.repeat = true; 
poleMaterial.animateUVs = true; 

var cG:CylinderGeometry = new CylinderGeometry(10, 10, 400); 
var mesh:Mesh = new Mesh(cG, poleMaterial); 

cG.topClosed = true; 
cG.scaleUV(1, 2); 

addChild(mesh); 

的.scaleUV部和.animateUVs只是一个猜测,试图解决问题...

任何想法如何使位图瓦片?当我忽略了尺度UV时,它会显示一次。当我放入刻度尺UV(1,2)时,它确实有点像瓷砖,但高度只有一半,并且有间隙。

我只想让它平滑地平铺。如果需要的话我可以重新纹理(现在它64×64,但这是任意)

它还需要瓷砖顺利即使cylinderGeometry将在高度变化(这可能发生,因为游戏的一部分)

同当然适用于拉伸。

谢谢!

回答

0

你接近:

var plane = new Mesh(new PlaneGeometry(3000,3000,30,30),new   TextureMaterial(Cast.bitmapTexture(groundMaterial))); 
plane.geometry.scaleUV(25, 25); // tiles my material of grass image 25x25 
plane.material.repeat = true; //repeats the my material 
scene.addchild(plane); 

让我知道,如果你有问题:) 添加要再次改变材料拼接的规模/拉伸重新添加该物质对对象每次与其新的属性。

+0

给你的奖金,因为你是唯一一个回答:) 真相在最后,问题是我的纹理 - 它不是从闪光输出作为2的干净力量,所以有黑色像素来填补空白;) – davidkomer

+0

大声笑,这是一个简单的解决方案时,它会伤害,Away3d文档可以改善一点,我发现教程和信息总是过时或信息像你经历失踪... – joshua