|
Revision 213, 0.8 kB
(checked in by dirk, 2 years ago)
|
Added simple benchmarking toolkit. Not for permanent use, just for now.
|
- Property svn:executable set to
*
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
from osgbench import * |
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
win=TestWindow() |
|---|
| 6 |
win.setSize(300,300) |
|---|
| 7 |
win.open() |
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
scene=Group() |
|---|
| 11 |
|
|---|
| 12 |
nc=6 |
|---|
| 13 |
|
|---|
| 14 |
for i in range(-nc,nc): |
|---|
| 15 |
inode=Group() |
|---|
| 16 |
scene.addChild(inode) |
|---|
| 17 |
for j in range(-nc,nc): |
|---|
| 18 |
jnode=Group() |
|---|
| 19 |
inode.addChild(jnode) |
|---|
| 20 |
for k in range(-nc,nc): |
|---|
| 21 |
trans=Transform() |
|---|
| 22 |
jnode.addChild(trans) |
|---|
| 23 |
trans.setTranslation(i*2, j*2, k*2) |
|---|
| 24 |
geo=makeBox(1,1,1, 1,1,1) |
|---|
| 25 |
trans.addChild(geo) |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
test=Test() |
|---|
| 29 |
test.setWindow(win) |
|---|
| 30 |
test.setNFrames(100) |
|---|
| 31 |
test.setScene(scene) |
|---|
| 32 |
|
|---|
| 33 |
test.addFov(90) |
|---|
| 34 |
test.makeOrbit(0,1,0) |
|---|
| 35 |
|
|---|
| 36 |
test.run() |
|---|
| 37 |
|
|---|
| 38 |
print "%d transformed cubes took %.2f seconds: %.2f fps" % ((nc*2)*(nc*2)*(nc*2), test.getTime(), test.getFPS()) |
|---|