ClusterConfig.py 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. from direct.showbase.PandaObject import *
  2. from ClusterClient import *
  3. import string
  4. # A dictionary of information for various cluster configurations.
  5. # Dictionary is keyed on cluster-config string
  6. # Each dictionary contains a list of display configurations, one for
  7. # each display in the cluster
  8. # Information that can be specified for each display:
  9. # display name: Name of display (used in Configrc to specify server)
  10. # display type: Used to flag client vs. server
  11. # pos: positional offset of display's camera from main cluster group
  12. # hpr: orientation offset of display's camera from main cluster group
  13. # focal length: display's focal length (in mm)
  14. # film size: display's film size (in inches)
  15. # film offset: offset of film back (in inches)
  16. # Note: Note, this overrides offsets specified in DirectCamConfig.py
  17. # For now we only specify frustum for first display region of configuration
  18. # TODO: Need to handle multiple display regions per cluster node and to
  19. # generalize to non cluster situations
  20. ClientConfigs = {
  21. 'single-server' : [{'display name' : 'display0',
  22. 'display mode' : 'client',
  23. 'pos' : Vec3(0),
  24. 'hpr' : Vec3(0)}
  25. ],
  26. 'two-server' : [{'display name' : 'master',
  27. 'display mode' : 'client',
  28. 'pos' : Vec3(0),
  29. 'hpr' : Vec3(30,0,0)},
  30. {'display name' : 'la',
  31. 'pos' : Vec3(0),
  32. 'hpr' : Vec3(-30,0,0)}
  33. ],
  34. 'mono-cave' : [{'display name' : 'la',
  35. 'pos' : Vec3(-0.105, -0.020, 5.000),
  36. 'hpr' : Vec3(51.213, 0.000, 0.000),
  37. 'focal length' : 0.809,
  38. 'film size' : (1.000, 0.831),
  39. 'film offset' : (0.000, 0.173),
  40. },
  41. {'display name' : 'lb',
  42. 'display mode' : 'client',
  43. 'pos' : Vec3(-0.105, -0.020, 5.000),
  44. 'hpr' : Vec3(-0.370, 0.000, 0.000),
  45. 'focal length' : 0.815,
  46. 'film size' : (1.000, 0.831),
  47. 'film offset' : (0.000, 0.173),
  48. },
  49. {'display name' : 'lc',
  50. 'pos' : Vec3(-0.105, -0.020, 5.000),
  51. 'hpr' : Vec3(-51.675, 0.000, 0.000),
  52. 'focal length' : 0.820,
  53. 'film size' : (1.000, 0.830),
  54. 'film offset' : (-0.000, 0.173),
  55. },
  56. ],
  57. 'seamless-cave' : [{'display name' : 'master',
  58. 'display mode' : 'client',
  59. 'pos' : Vec3(-0.105, -0.020, 5.000),
  60. 'hpr' : Vec3(-0.370, 0.000, 0.000),
  61. 'focal length' : 0.815,
  62. 'film size' : (1.000, 0.831),
  63. 'film offset' : (0.000, 0.173),
  64. },
  65. {'display name' : 'la',
  66. 'pos' : Vec3(-0.105, -0.020, 5.000),
  67. 'hpr' : Vec3(51.213, 0.000, 0.000),
  68. 'focal length' : 0.809,
  69. 'film size' : (1.000, 0.831),
  70. 'film offset' : (0.000, 0.173),
  71. },
  72. {'display name' : 'lb',
  73. 'pos' : Vec3(-0.105, -0.020, 5.000),
  74. 'hpr' : Vec3(-0.370, 0.000, 0.000),
  75. 'focal length' : 0.815,
  76. 'film size' : (1.000, 0.831),
  77. 'film offset' : (0.000, 0.173),
  78. },
  79. {'display name' : 'lc',
  80. 'pos' : Vec3(-0.105, -0.020, 5.000),
  81. 'hpr' : Vec3(-51.675, 0.000, 0.000),
  82. 'focal length' : 0.820,
  83. 'film size' : (1.000, 0.830),
  84. 'film offset' : (-0.000, 0.173),
  85. },
  86. {'display name' : 'ra',
  87. 'pos' : Vec3(0.105, -0.020, 5.000),
  88. 'hpr' : Vec3(51.675, 0.000, 0.000),
  89. 'focal length' : 0.820,
  90. 'film size' : (1.000, 0.830),
  91. 'film offset' : (0.000, 0.173),
  92. },
  93. {'display name' : 'rb',
  94. 'pos' : Vec3(0.105, -0.020, 5.000),
  95. 'hpr' : Vec3(0.370, 0.000, 0.000),
  96. 'focal length' : 0.815,
  97. 'film size' : (1.000, 0.831),
  98. 'film offset' : (0.000, 0.173),
  99. },
  100. {'display name' : 'rc',
  101. 'pos' : Vec3(0.105, -0.020, 5.000),
  102. 'hpr' : Vec3(-51.213, 0.000, 0.000),
  103. 'focal length' : 0.809,
  104. 'film size' : (1.000, 0.831),
  105. 'film offset' : (-0.000, 0.173),
  106. },
  107. ],
  108. 'nemo-cave' : [{'display name' : 'master',
  109. 'display mode' : 'client',
  110. 'pos' : Vec3(-0.105, -0.020, 5.000),
  111. 'hpr' : Vec3(-0.370, 0.000, 0.000),
  112. 'focal length' : 0.815,
  113. 'film size' : (1.000, 0.831),
  114. 'film offset' : (0.000, 0.173),
  115. },
  116. {'display name' : 'la',
  117. 'pos' : Vec3(-0.105, -0.020, 5.000),
  118. 'hpr' : Vec3(51.213, 0.000, 0.000),
  119. 'focal length' : 0.809,
  120. 'film size' : (1.000, 0.831),
  121. 'film offset' : (0.000, 0.173),
  122. },
  123. {'display name' : 'lb',
  124. 'pos' : Vec3(-0.105, -0.020, 5.000),
  125. 'hpr' : Vec3(-0.370, 0.000, 0.000),
  126. 'focal length' : 0.815,
  127. 'film size' : (1.000, 0.831),
  128. 'film offset' : (0.000, 0.173),
  129. },
  130. {'display name' : 'lc',
  131. 'pos' : Vec3(-0.105, -0.020, 5.000),
  132. 'hpr' : Vec3(-51.675, 0.000, 0.000),
  133. 'focal length' : 0.820,
  134. 'film size' : (1.000, 0.830),
  135. 'film offset' : (-0.000, 0.173),
  136. },
  137. {'display name' : 'ra',
  138. 'pos' : Vec3(0.105, -0.020, 5.000),
  139. 'hpr' : Vec3(51.675, 0.000, 0.000),
  140. 'focal length' : 0.820,
  141. 'film size' : (1.000, 0.830),
  142. 'film offset' : (0.000, 0.173),
  143. },
  144. {'display name' : 'rb',
  145. 'pos' : Vec3(0.105, -0.020, 5.000),
  146. 'hpr' : Vec3(0.370, 0.000, 0.000),
  147. 'focal length' : 0.815,
  148. 'film size' : (1.000, 0.831),
  149. 'film offset' : (0.000, 0.173),
  150. },
  151. {'display name' : 'rc',
  152. 'pos' : Vec3(0.105, -0.020, 5.000),
  153. 'hpr' : Vec3(-51.213, 0.000, 0.000),
  154. 'focal length' : 0.809,
  155. 'film size' : (1.000, 0.831),
  156. 'film offset' : (-0.000, 0.173),
  157. },
  158. {'display name' : 'lAudienceL',
  159. 'pos' : Vec3(-4.895, -0.020, 5.000),
  160. 'hpr' : Vec3(51.213, 0.000, 0.000),
  161. 'focal length' : 0.809,
  162. 'film size' : (1.000, 0.831),
  163. 'film offset' : (0.000, 0.173),
  164. },
  165. {'display name' : 'rAudienceL',
  166. 'pos' : Vec3(-5.105, -8.0, 5.000),
  167. 'hpr' : Vec3(51.675, 0.000, 0.000),
  168. 'focal length' : 0.820,
  169. 'film size' : (1.000, 0.830),
  170. 'film offset' : (0.000, 0.173),
  171. },
  172. {'display name' : 'lAudienceR',
  173. 'pos' : Vec3(5.105, -0.020, 5.000),
  174. 'hpr' : Vec3(-51.213, 0.000, 0.000),
  175. 'focal length' : 0.809,
  176. 'film size' : (1.000, 0.831),
  177. 'film offset' : (0.000, 0.173),
  178. },
  179. {'display name' : 'rAudienceR',
  180. 'pos' : Vec3(4.895, -8.0, 5.000),
  181. 'hpr' : Vec3(-51.675, 0.000, 0.000),
  182. 'focal length' : 0.820,
  183. 'film size' : (1.000, 0.830),
  184. 'film offset' : (0.000, 0.173),
  185. },
  186. ],
  187. 'nemo-cave-narrow' : [{'display name' : 'master',
  188. 'display mode' : 'client',
  189. 'pos' : Vec3(-0.105, -0.020, 5.000),
  190. 'hpr' : Vec3(-0.370, 0.000, 0.000),
  191. 'focal length' : 0.815,
  192. 'film size' : (1.000, 0.831),
  193. 'film offset' : (0.000, 0.173),
  194. },
  195. {'display name' : 'la',
  196. 'pos' : Vec3(-0.105, -19.890, 4.500),
  197. 'hpr' : Vec3(51.500, 0.000, 0.000),
  198. 'focal length' : 1.662,
  199. 'film size' : (1.000, 0.828),
  200. 'film offset' : (1.079, 0.207),
  201. },
  202. {'display name' : 'lb',
  203. 'pos' : Vec3(-0.105, -19.890, 4.500),
  204. 'hpr' : Vec3(0.000, 0.000, 0.000),
  205. 'focal length' : 2.186,
  206. 'film size' : (1.000, 0.828),
  207. 'film offset' : (0.007, 0.207),
  208. },
  209. {'display name' : 'lc',
  210. 'pos' : Vec3(-0.105, -19.890, 4.500),
  211. 'hpr' : Vec3(-51.500, 0.000, 0.000),
  212. 'focal length' : 1.673,
  213. 'film size' : (1.000, 0.828),
  214. 'film offset' : (-1.070, 0.207),
  215. },
  216. {'display name' : 'ra',
  217. 'pos' : Vec3(0.105, -19.890, 4.500),
  218. 'hpr' : Vec3(51.500, 0.000, 0.000),
  219. 'focal length' : 1.673,
  220. 'film size' : (1.000, 0.828),
  221. 'film offset' : (1.070, 0.207),
  222. },
  223. {'display name' : 'rb',
  224. 'pos' : Vec3(0.105, -19.890, 4.500),
  225. 'hpr' : Vec3(0.000, 0.000, 0.000),
  226. 'focal length' : 2.186,
  227. 'film size' : (1.000, 0.828),
  228. 'film offset' : (-0.007, 0.207),
  229. },
  230. {'display name' : 'rc',
  231. 'pos' : Vec3(0.105, -19.890, 4.500),
  232. 'hpr' : Vec3(-51.500, 0.000, 0.000),
  233. 'focal length' : 1.662,
  234. 'film size' : (1.000, 0.828),
  235. 'film offset' : (-1.079, 0.207),
  236. },
  237. {'display name' : 'lAudienceL',
  238. 'pos' : Vec3(-0.105, -19.890, 4.500),
  239. 'hpr' : Vec3(49.038, 0.000, 0.000),
  240. 'focal length' : 1.452,
  241. 'film size' : (1.000, 0.797),
  242. 'film offset' : (-0.292, 0.149),
  243. },
  244. {'display name' : 'rAudienceL',
  245. 'pos' : Vec3(0.105, -19.890, 4.500),
  246. 'hpr' : Vec3(49.038, 0.000, 0.000),
  247. 'focal length' : 1.468,
  248. 'film size' : (1.000, 0.797),
  249. 'film offset' : (-0.306, 0.149),
  250. },
  251. {'display name' : 'lAudienceR',
  252. 'pos' : Vec3(-0.105, -19.890, 4.500),
  253. 'hpr' : Vec3(-52.750, 0.000, 0.000),
  254. 'focal length' : 1.551,
  255. 'film size' : (1.000, 0.796),
  256. 'film offset' : (0.245, 0.149),
  257. },
  258. {'display name' : 'rAudienceR',
  259. 'pos' : Vec3(0.105, -19.890, 4.500),
  260. 'hpr' : Vec3(-52.750, 0.000, 0.000),
  261. 'focal length' : 1.534,
  262. 'film size' : (1.000, 0.796),
  263. 'film offset' : (0.232, 0.149),
  264. },
  265. {'display name' : 'lCart',
  266. 'pos' : Vec3(-0.105, -0.020, 5.000),
  267. 'hpr' : Vec3(-0.370, 0.000, 0.000),
  268. 'focal length' : 0.815,
  269. 'film size' : (1.000, 0.831),
  270. 'film offset' : (0.000, 0.173),
  271. },
  272. {'display name' : 'rCart',
  273. 'pos' : Vec3(0.105, -0.020, 5.000),
  274. 'hpr' : Vec3(0.370, 0.000, 0.000),
  275. 'focal length' : 0.815,
  276. 'film size' : (1.000, 0.831),
  277. 'film offset' : (0.000, 0.173),
  278. },
  279. ],
  280. 'fourd-cave' : [{'display name' : 'master',
  281. 'display mode' : 'client',
  282. 'pos' : Vec3(-0.105, -0.020, 5.000),
  283. 'hpr' : Vec3(-0.370, 0.000, 0.000),
  284. 'focal length' : 0.815,
  285. 'film size' : (1.000, 0.831),
  286. 'film offset' : (0.000, 0.173),
  287. },
  288. {'display name' : 'la',
  289. 'pos' : Vec3(-0.105, -0.020, 5.000),
  290. 'hpr' : Vec3(51.213, 0.000, 0.000),
  291. 'focal length' : 0.809,
  292. 'film size' : (1.000, 0.831),
  293. 'film offset' : (0.000, 0.173),
  294. },
  295. {'display name' : 'lb',
  296. 'pos' : Vec3(-0.105, -0.020, 5.000),
  297. 'hpr' : Vec3(-0.370, 0.000, 0.000),
  298. 'focal length' : 0.815,
  299. 'film size' : (1.000, 0.831),
  300. 'film offset' : (0.000, 0.173),
  301. },
  302. {'display name' : 'lc',
  303. 'pos' : Vec3(-0.105, -0.020, 5.000),
  304. 'hpr' : Vec3(-51.675, 0.000, 0.000),
  305. 'focal length' : 0.820,
  306. 'film size' : (1.000, 0.830),
  307. 'film offset' : (-0.000, 0.173),
  308. },
  309. {'display name' : 'ra',
  310. 'pos' : Vec3(0.105, -0.020, 5.000),
  311. 'hpr' : Vec3(51.675, 0.000, 0.000),
  312. 'focal length' : 0.820,
  313. 'film size' : (1.000, 0.830),
  314. 'film offset' : (0.000, 0.173),
  315. },
  316. {'display name' : 'rb',
  317. 'pos' : Vec3(0.105, -0.020, 5.000),
  318. 'hpr' : Vec3(0.370, 0.000, 0.000),
  319. 'focal length' : 0.815,
  320. 'film size' : (1.000, 0.831),
  321. 'film offset' : (0.000, 0.173),
  322. },
  323. {'display name' : 'rc',
  324. 'pos' : Vec3(0.105, -0.020, 5.000),
  325. 'hpr' : Vec3(-51.213, 0.000, 0.000),
  326. 'focal length' : 0.809,
  327. 'film size' : (1.000, 0.831),
  328. 'film offset' : (-0.000, 0.173),
  329. },
  330. {'display name' : 'lAudienceL',
  331. 'pos' : Vec3(-4.895, -0.020, 5.000),
  332. 'hpr' : Vec3(65.213, 0.000, 0.000),
  333. 'focal length' : 0.809,
  334. 'film size' : (1.000, 0.831),
  335. 'film offset' : (0.000, 0.173),
  336. },
  337. {'display name' : 'rAudienceL',
  338. 'pos' : Vec3(-5.105, -8.0, 5.000),
  339. 'hpr' : Vec3(65.675, 0.000, 0.000),
  340. 'focal length' : 0.820,
  341. 'film size' : (1.000, 0.830),
  342. 'film offset' : (0.000, 0.173),
  343. },
  344. {'display name' : 'lAudienceR',
  345. 'pos' : Vec3(5.105, -0.020, 5.000),
  346. 'hpr' : Vec3(-65.213, 0.000, 0.000),
  347. 'focal length' : 0.809,
  348. 'film size' : (1.000, 0.831),
  349. 'film offset' : (0.000, 0.173),
  350. },
  351. {'display name' : 'rAudienceR',
  352. 'pos' : Vec3(4.895, -8.0, 5.000),
  353. 'hpr' : Vec3(-65.675, 0.000, 0.000),
  354. 'focal length' : 0.820,
  355. 'film size' : (1.000, 0.830),
  356. 'film offset' : (0.000, 0.173),
  357. },
  358. ],
  359. 'parallax-cave' : [{'display name' : 'master',
  360. 'display mode' : 'client',
  361. 'pos': Vec3(0),
  362. 'hpr': Vec3(0),
  363. 'focal length' : 0.815,
  364. 'film size' : (1.000, 0.831),
  365. 'film offset' : (0.000, 0.173),
  366. },
  367. {'display name' : 'la',
  368. 'pos': Vec3(0),
  369. 'hpr': Vec3(0),
  370. 'focal length' : 0.809,
  371. 'film size' : (1.000, 0.831),
  372. 'film offset' : (0.000, 0.173),
  373. },
  374. {'display name' : 'lb',
  375. 'pos': Vec3(0),
  376. 'hpr': Vec3(0),
  377. 'focal length' : 0.815,
  378. 'film size' : (1.000, 0.831),
  379. 'film offset' : (0.000, 0.173),
  380. },
  381. {'display name' : 'lc',
  382. 'pos': Vec3(0),
  383. 'hpr': Vec3(0),
  384. 'focal length' : 0.820,
  385. 'film size' : (1.000, 0.830),
  386. 'film offset' : (-0.000, 0.173),
  387. },
  388. {'display name' : 'ra',
  389. 'pos': Vec3(0),
  390. 'hpr': Vec3(0),
  391. 'focal length' : 0.820,
  392. 'film size' : (1.000, 0.830),
  393. 'film offset' : (0.000, 0.173),
  394. },
  395. {'display name' : 'rb',
  396. 'pos': Vec3(0),
  397. 'hpr': Vec3(0),
  398. 'focal length' : 0.815,
  399. 'film size' : (1.000, 0.831),
  400. 'film offset' : (0.000, 0.173),
  401. },
  402. {'display name' : 'rc',
  403. 'pos': Vec3(0),
  404. 'hpr': Vec3(0),
  405. 'focal length' : 0.809,
  406. 'film size' : (1.000, 0.831),
  407. 'film offset' : (-0.000, 0.173),
  408. },
  409. ],
  410. 'carttest' : [{'display name' : 'master',
  411. 'display mode' : 'client',
  412. 'pos' : Vec3(0),
  413. 'hpr' : Vec3(0),
  414. },
  415. {'display name' : 'left',
  416. 'pos' : Vec3(-.105,0,0),
  417. 'hpr' : Vec3(0,0,0)},
  418. {'display name' : 'right',
  419. 'pos' : Vec3(.105,0,0),
  420. 'hpr' : Vec3(0,0,0)}
  421. ],
  422. 'ursula' : [{'display name' : 'master',
  423. 'display mode' : 'client',
  424. 'pos' : Vec3(0),
  425. 'hpr' : Vec3(0),
  426. },
  427. {'display name' : 'l',
  428. 'pos' : Vec3(-.105,0,0),
  429. 'hpr' : Vec3(0,0,0),
  430. 'focal length' : 15,
  431. 'film size' : (13.33, 10),
  432. #'film offset' : (0.105, -2),
  433. 'film offset' : (0.105, -1),
  434. },
  435. {'display name' : 'r',
  436. 'pos' : Vec3(.105,0,0),
  437. 'hpr' : Vec3(0,0,0),
  438. 'focal length' : 15,
  439. 'film size' : (13.33, 10),
  440. #'film offset' : (-0.105, -2),
  441. 'film offset' : (-0.105, -1),
  442. }
  443. ],
  444. 'composite' : [{'display name' : 'master',
  445. 'display mode' : 'client',
  446. 'pos' : Vec3(0),
  447. },
  448. {'display name' : 'left',
  449. 'pos' : Vec3(-0.105, -0.020, 5.000),
  450. 'hpr' : Vec3(-0.370, 0.000, 0.000),
  451. 'focal length' : 0.815,
  452. 'film size' : (1.000, 0.831),
  453. 'film offset' : (0.000, 0.173),
  454. },
  455. {'display name' : 'right',
  456. 'pos' : Vec3(0.105, -0.020, 5.000),
  457. 'hpr' : Vec3(0.370, 0.000, 0.000),
  458. 'focal length' : 0.815,
  459. 'film size' : (1.000, 0.831),
  460. 'film offset' : (0.000, 0.173),
  461. }
  462. ],
  463. }