fixed: gcc8 compile issues
[opensg.git] / Tools / osgBench / run_model.py
blob88307c7c48d9dee26c43243000613870e00ee53c
1 # Simple OpenSG Benchmark
2 from osgbench import *
3 from sys import argv, exit
4 import getopt
5 from string import atof, atoi
7 # options
9 ups="0,0,1"
10 frames=100
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)
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
29 # Load the scene
30 print "Loading " + args[0] + "..."
31 scene=loadScene(args[0])
33 # Define the Window's parameters
34 win=TestWindow()
35 win.setSize(900, 900)
36 win.open()
38 # Define the Test(s)
39 test=Test()
40 test.setWindow(win)
41 test.setScene(scene)
42 test.setNFrames(frames)
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)
51 test.run()
52 print "Path took %f seconds: %f fps" % (test.getTime(), test.getFPS())
54 win.close()