root/branches/Carsten_PtrWork2/Tools/osgBench/q2.py

Revision 213, 0.7 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 # Simple OpenSG benchmark
2 from osgbench import *
3
4 # Define the Window's parameters
5 win=TestWindow()
6 win.setSize(300,300)
7 win.open()
8
9 # Create the scene
10 scene=Group()
11
12 nc=4
13
14 for i in range(-nc,nc):
15     for j in range(-nc,nc):
16         for k in range(-nc,nc):
17             trans=Transform()
18             scene.addChild(trans)           
19             trans.setTranslation(i*2, j*2, k*2)
20             geo=makeBox(1,1,1, 1,1,1)
21             trans.addChild(geo)
22
23 scene.addChild(makeBox(1,1,1, 1,1,1))
24
25 # Define the Test(s)
26 test=Test()
27 test.setWindow(win)
28 test.setNFrames(100)
29 test.setScene(scene)
30
31 test.addFov(100)
32 test.makeOrbit(0,1,0)
33
34 test.run()
35
36 print "%d transformed cubes took %f seconds: %.3f fps" % ((nc*2)*(nc*2)*(nc*2), test.getTime(), test.getFPS())
Note: See TracBrowser for help on using the browser.