纳金网
标题:
Alternativa3D用修改plane类实现平铺材质
[打印本页]
作者:
小声飞
时间:
2012-12-11 14:41
标题:
Alternativa3D用修改plane类实现平铺材质
在构造方法里加两个参数tileU:uint=1,tileV:uint=1
横向平铺数量 纵向平铺数量
对应修改原始的代码就可以了
var segmentUSize:Number = tileU/widthSegments;
var segmentVSize:Number = tileV/lengthSegments;
public function Plane(width:Number = 100, length:Number = 100, widthSegments:uint = 1, lengthSegments:uint = 1,tileU:uint=1,tileV:uint=1, twoSided:Boolean = ***e, reverse:Boolean = false, bottom:Material = null, top:Material = null) {
if (widthSegments <= 0 || lengthSegments <= 0) return;
var indices:Vector.<uint> = new Vector.<uint>();
var x:int;
var y:int;
var wEdges:int = widthSegments + 1;
var lEdges:int = lengthSegments + 1;
var halfWidth:Number = width*0.5;
var halfLength:Number = length*0.5;
var segmentUSize:Number = tileU/widthSegments;
var segmentVSize:Number = tileV/lengthSegments;
var segmentWidth:Number = width/widthSegments;
var segmentLength:Number = length/lengthSegments;
欢迎光临 纳金网 (http://course.narkii.com/club/)
Powered by Discuz! X2.5