AGAL foursquare - Квадрат на Агале

Feb 08, 2017 20:02



private function foursquareAgal(returnVariable:String = "ft1.x", sizeValue:String = "fc0.x", coordInput:String = "v1"):String {
var code:String = "";
// 1. vec2 r=abs(c.xy);
code += "abs ft1.xy, "+coordInput+".xy \n"; // Абсолютная координата
// 2. float s=step(.5,max(r.x,r.y));
// 2.1 max(r.x,r.y)
code += "max ft1.x, ft1.x, ft1.y \n"; // Максимальная x или y -> ft1y
// 2.2 step(.5, {2.1}) -> For element i of the return value, 0.0 is returned if x[i] < edge[i], and 1.0 is returned otherwise.
code += "sge "+returnVariable+", "+sizeValue+", ft1.x \n"; // ft2x = (ft1y >= 0.5) ? 1 : 0
return code;
}

stage3d, agal

Previous post Next post
Up