64 |
|
|
65 |
dbg = 0 |
dbg = 0 |
66 |
|
|
|
def randvec(rnd): return [rnd.nextDouble() for i in range(0,3)] |
|
|
|
|
|
def randunitvec(rnd): |
|
|
x = 2 * rnd.nextDouble() - 1 |
|
|
y = 2 * rnd.nextDouble() - 1 |
|
|
z = 2 * rnd.nextDouble() - 1 |
|
|
m = 1./Math.sqrt(x*x+y*y+z*z)*.5 |
|
|
return [m * x + .5, m * y + .5, m * z + .5] |
|
|
|
|
|
|
|
67 |
def selectRandom(list, gen): |
def selectRandom(list, gen): |
68 |
return list[gen.nextInt(len(list))] |
return list[gen.nextInt(len(list))] |
69 |
|
|
|
def selectDet(list, type): |
|
|
return ( list[type % len(list)], type / len(list) ) |
|
|
|
|
70 |
def setSolidPass(pas, color): |
def setSolidPass(pas, color): |
71 |
pas.setSetupcode(""" |
pas.setSetupcode(""" |
72 |
PushAttrib ENABLE_BIT TEXTURE_BIT |
PushAttrib ENABLE_BIT TEXTURE_BIT |
187 |
""" |
""" |
188 |
|
|
189 |
code += ( |
code += ( |
190 |
sh.setupCode() + |
sh.setupCode(rnd) + |
191 |
comb.setupCode(sh.getRGBoutputs(), sh.getRGBoutputscales(), colors, rnd, trans) |
comb.setupCode(sh.getRGBoutputs(), sh.getRGBoutputscales(), colors, rnd, trans) |
192 |
) |
) |
193 |
|
|