//Tessellate negative or positive value into range: 0-4. var xNum = 5; //means that we will modulate between 0 to 4. var outp:int; for (var i:int = -10; i<10; i++){ outp = i % xNum; if(outp<0){outp = xNum + outp;} trace("["+i+"] --->" + outp ); }
No comments:
Post a Comment