刚刚开始学习使用alternative3d
在Alternativa3D官方教程中,材质那一篇文章中 http://docs.alternativaplatform.com/display/TDEN/Materials
用代码创建模型,并分配uv坐标。始终不理解uv坐标是怎么回事。
参考了http://www.rozengain.com/blog/2007/08/26/uv-coordinate-basics/文章后 终于有了点思路。
使用 http://docs.alternativaplatform.com/download/attachments/22413370/TexturingTutorial.zip?version=1 的方式创建了一个cube
修改了例子中的
override protected function setMaterials():void 和 private function setUVs():void 方法
修改成如下

Code
override protected function setMaterials():void {
setUVs();
setMaterialToSurface(new TextureMaterial(wallTexture), "walls");
setMaterialToSurface(new TextureMaterial(wallTexture), "vtop");
setMaterialToSurface(new TextureMaterial(wallTexture), "vbottom");
}
private function setUVs():void {
setUVsToFace(new Point(1/3, 0), new Point(2/3, 0), new Point(2/3, 0.5), "wall_0");
setUVsToFace(new Point(2/3, 0), new Point(1, 0), new Point(1, 0.5), "wall_2");
setUVsToFace(new Point(0, 0.5), new Point(1/3, 0.5), new Point(1/3, 1), "wall_1");
setUVsToFace(new Point(1/3, 0.5), new Point(2/3, 0.5), new Point(2/3, 1), "wall_3");
setUVsToFace(new Point(0, 0), new Point(1/3, 0), new Point(1/3, 0.5), "vtop");
setUVsToFace(new Point(2/3, 0.5), new Point(1, 0.5), new Point(1, 1), "vbottom");
}
以下是我的源码,希望对大家有帮助
/Files/unidw/TexturingTutorial.rar