8 |
|
|
9 |
class Scene: |
class Scene: |
10 |
"""Show some basis textures and what the NV10 register combiners can do with them. |
"""Show some basis textures and what the NV10 register combiners can do with them. |
11 |
|
|
12 |
|
The small squares show the randomly selected colors used in the real outputs. |
13 |
|
The text shows the combiner code currently used for the intersection. |
14 |
""" |
""" |
15 |
def __init__(self): |
def __init__(self): |
16 |
self.bgcolor = (0.7, 0.8, 0.6) |
self.bgcolor = (0.7, 0.8, 0.6) |
22 |
self.key = KeyPresses(self, |
self.key = KeyPresses(self, |
23 |
ListIndex("ccind", "combinercodes", 0, "combiner code for intersection region", "<", ">", |
ListIndex("ccind", "combinercodes", 0, "combiner code for intersection region", "<", ">", |
24 |
noAnimation = 1), |
noAnimation = 1), |
25 |
|
*self.pt.keys |
26 |
) |
) |
27 |
# else: |
# else: |
28 |
# self.pt.key(k) |
# self.pt.key(k) |
30 |
def scene(self, vs): |
def scene(self, vs): |
31 |
putnoc(vs, background(self.bgcolor)) |
putnoc(vs, background(self.bgcolor)) |
32 |
|
|
33 |
cs = vs.orthoCS(0, "S1", 0, 100, 100, 200, 200) |
cs = vs.orthoCS(0, "S1", 0, 50, 50, 400, 400) |
34 |
self.pt.place(vs, cs, "RGB0", self.combinercodes[self.ccind], "RGB1") |
self.pt.place(vs, cs, "RGB0", self.combinercodes[self.ccind], "RGB1") |
35 |
|
|
36 |
for i in range(0,3): |
for i in range(0,3): |
37 |
cs = vs.coords.affineCoordsys(0, 10, 600 + (i-1)*150, 80, 50, 0, 0, 50) |
cs = vs.coords.affineCoordsys(0, 10, 700 + (i-1)*80, 80, 50, 0, 0, 50) |
38 |
vs.matcher.add(cs, "col" + str(i)) |
vs.matcher.add(cs, "col" + str(i)) |
39 |
col = self.pt.cols[i].split() |
col = self.pt.cols[i].split() |
40 |
cq = coloredQuad((col[0], col[1], col[2])) |
cq = coloredQuad((col[0], col[1], col[2])) |
41 |
vs.map.put(cq, cs) |
vs.map.put(cq, cs) |
42 |
vs.map.put(self.pt.frame, cs) |
vs.map.put(self.pt.frame, cs) |
43 |
|
|
44 |
tcs = vs.orthoCS(0, "TXT", 0, 500, 300, 1, 1) |
tcs = vs.orthoCS(0, "TXT", 0, 650, 300, 1, 1) |
45 |
vs.map.put(getDListNocoords(""" |
vs.map.put(getDListNocoords(""" |
46 |
Disable REGISTER_COMBINERS_NV |
Disable REGISTER_COMBINERS_NV |
47 |
Color 0 0 0 1 |
Color 0 0 0 1 |
48 |
Disable ALPHA_TEST |
Disable ALPHA_TEST |
49 |
Enable TEXTURE_2D |
Enable TEXTURE_2D |
50 |
""")) |
""")) |
51 |
misc.putMultilineText (vs, tcs, texcodes[self.combinercodes[self.ccind]], 20) |
misc.putMultilineText (vs, tcs, texcodes[self.combinercodes[self.ccind]], 15) |