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

Revision 397, 1.1 kB (checked in by dshipton, 2 years ago)

Merge Dirks RenderTraversal? branch back into trunk.
This add's Occlusion Culling and a new node type called ScreenLOD
which is an automatic LOD node.

  • Property svn:executable set to *
Line 
1 # Simple OpenSG Benchmark
2 from osgbench import *
3 from sys import argv, exit
4 import getopt
5 from string import atof, atoi
6
7 # options
8
9 ups="0,0,1"
10 frames=100
11
12 # command line handling
13 try:                               
14     opts, args = getopt.getopt(argv[1:], "u:f:h", ["up=", "frames=", "help"])
15 except getopt.GetoptError:           
16     exit(2)
17
18 for opt, arg in opts:               
19     if opt in ("-h", "--help"):     
20         sys.exit()                 
21     elif opt == '-u':               
22         ups=arg
23         print "Up set to ", ups
24     elif opt == '-f':               
25         frames=atoi(arg)
26         print "Frames set to ", frames
27
28
29 # Load the scene
30 print "Loading " + args[0] + "..."
31 scene=loadScene(args[0])
32
33 # Define the Window's parameters
34 win=TestWindow()
35 win.setSize(900, 900)
36 win.open()
37
38 # Define the Test(s)
39 test=Test()
40 test.setWindow(win)
41 test.setScene(scene)
42 test.setNFrames(frames)
43
44 test.clear()
45 test.addFov(60)
46 up=ups.split(',')
47 test.makeOrbit(atof(up[0]),atof(up[1]),atof(up[2]))
48 #test.setIgnoreGeometry(True)
49 test.useRenderTraversal(True)
50
51 test.run()
52 print "Path took %f seconds: %f fps" % (test.getTime(), test.getFPS())
53
54 win.close()
55
Note: See TracBrowser for help on using the browser.