~jtaylor/ubuntu/oneiric/soya/fix-780305

« back to all changes in this revision

Viewing changes to c_src/python/test10.py

  • Committer: Bazaar Package Importer
  • Author(s): Marc Dequènes (Duck)
  • Date: 2005-01-30 09:55:06 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050130095506-f21p6v6cgaobhn5j
Tags: 0.9.2-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
import soya.model
3
 
import soya.soya3d
4
 
import soya.land
5
 
 
6
 
import _soya
7
 
 
8
 
import random
9
 
 
10
 
import soya.editor
11
 
import Tkinter
12
 
 
13
 
 
14
 
import soya.cube
15
 
import soya.laser
16
 
 
17
 
 
18
 
soya.init()
19
 
 
20
 
w=soya.soya3d.World()
21
 
 
22
 
soya.model.Material.PATH = "/home/blam/prog/slune/materials"
23
 
soya.model.Shape.PATH = "/home/blam/prog/slune/shapes"
24
 
soya.soya3d.World.PATH = "/home/blam/prog/slune/worlds"
25
 
 
26
 
s = soya.soya3d.World.get('gnu1')
27
 
s.shapify_args[1]['line_width'] = 8.0
28
 
w.shape = s.shapify()
29
 
 
30
 
 
31
 
soya.editor.edit(w)
32
 
 
33
 
atm = soya.soya3d.Atmosphere()
34
 
atm.bg_color=(0.4, 0.4, 1.0, 1.0)
35
 
w.get_root().atmosphere = atm
36
 
 
37
 
Tkinter.mainloop()
38
 
 
39
 
 
40
 
 
41
 
 
42
 
 
43
 
 
44
 
 
45
 
 
46
 
 
47
 
 
48
 
## w = soya.soya3d.World.get ('world-racinde')
49
 
 
50
 
## land = w.shape
51
 
## light = w.children[0]
52
 
 
53
 
## #land.fade_borders ((1.0, 1.0, 0.0, 0.0))
54
 
 
55
 
## land.fade_borders((1.0, 1.0, 1.0, 0.0))
56
 
## #land.compute_shadow_color(light, (0.6, 0.6, 0.6, 1.0))
57
 
 
58
 
## land.init_fx()
59
 
 
60
 
## #land.vertex_fx (None, (0.0, 0.0, 0.0, 0.0))
61
 
 
62
 
## land.vertex_fx((18.0, 9.0, 6.0), (1.0, 1.0, 1.0, 0.0), 20.0)
63
 
 
64
 
 
65
 
## laser = soya.laser.Laser(w)
66
 
## laser._matrix = (1.0, 0.0,  0.0, 0.0,
67
 
##                  0.0, 0.0, -1.0, 0.0,
68
 
##                  0.0, 1.0,  0.0, 0.0,
69
 
##                  15.0, 10.0, 5.0, 1.0,
70
 
##                  1.0, 1.0, 1.0)
71
 
 
72
 
## soya.editor.edit(w)
73
 
## Tkinter.mainloop()
74
 
 
75
 
 
76
 
#c = soya.cube.Cube ()
77
 
#for f in c:
78
 
#    f.smooth_lit = 1
79
 
#c.shapify()
80
 
 
81
 
 
82
 
# TEST BSP
83
 
 
84
 
## w1 = soya.soya3d.World()
85
 
 
86
 
## for i in xrange(100):
87
 
##   x =   random.random() * 10.0 - 5.0
88
 
##   y =   random.random() * 10.0 - 5.0
89
 
##   z = - random.random() * 10.0
90
 
##   vs = []
91
 
##   j = 0
92
 
##   while (j < 3):
93
 
##     v = soya.model.Vertex(w1, random.random() * 4.0 + x, random.random() * 4.0 + y, random.random() * 5.0 + z, color = (random.random(), random.random(), random.random(), random.random()))
94
 
##     vs.append(v)
95
 
##     j += 1
96
 
  
97
 
##   f = soya.model.Face (w1, vs)
98
 
##   f.double_sided = 1
99
 
 
100
 
 
101
 
## m = w1.shapify()
102
 
 
103
 
## w = soya.soya3d.World()
104
 
## w.set_shape(m)
105
 
 
106
 
## print 'ok'
107
 
 
108
 
#soya.editor.edit(w)
109
 
#Tkinter.mainloop()
110
 
 
111
 
 
112
 
# TEST SPRITE
113
 
 
114
 
## class Sprite(_soya._Sprite):
115
 
##   pass
116
 
 
117
 
## class Particles(_soya._Particles):
118
 
##   pass
119
 
 
120
 
 
121
 
## w = soya.soya3d.World ()
122
 
 
123
 
## soya.model.Material.PATH = "/home/jiba/python/slune/materials"
124
 
## mat1 = soya.model.Material.get("fx")
125
 
 
126
 
 
127
 
## s = Sprite()
128
 
## w.add (s)
129
 
## s.material = mat1
130
 
## s.width = 2.0
131
 
## s.color = (1.0, 1.0, 0.0, 0.8)
132
 
 
133
 
## print 'ok'
134
 
 
135
 
## soya.editor.edit(w)
136
 
## Tkinter.mainloop()
137