OpenGLContext 3.0.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. OpenGLContext/__init__.py +151 -0
  2. OpenGLContext/arrays.py +2 -0
  3. OpenGLContext/atlas.py +300 -0
  4. OpenGLContext/audio/__init__.py +32 -0
  5. OpenGLContext/audio/scene.py +130 -0
  6. OpenGLContext/audio/settings.py +82 -0
  7. OpenGLContext/bin/__init__.py +0 -0
  8. OpenGLContext/bin/choosecontext.py +224 -0
  9. OpenGLContext/bin/choosefonts.py +209 -0
  10. OpenGLContext/bin/gltest.py +121 -0
  11. OpenGLContext/bin/gltf_demo.py +492 -0
  12. OpenGLContext/bin/gltf_regression.py +645 -0
  13. OpenGLContext/bin/gltf_view.py +30 -0
  14. OpenGLContext/bin/keyboardevents.py +93 -0
  15. OpenGLContext/bin/lorentz.py +109 -0
  16. OpenGLContext/bin/physics_cook.py +81 -0
  17. OpenGLContext/bin/profile_view.py +38 -0
  18. OpenGLContext/bin/terrain_view.py +581 -0
  19. OpenGLContext/bin/tiles_view.py +39 -0
  20. OpenGLContext/bin/ui_demo.py +228 -0
  21. OpenGLContext/bin/view.py +341 -0
  22. OpenGLContext/bin/vrml_view.py +42 -0
  23. OpenGLContext/capture.py +125 -0
  24. OpenGLContext/context.py +1253 -0
  25. OpenGLContext/contextconfig.py +177 -0
  26. OpenGLContext/contextdefinition.py +275 -0
  27. OpenGLContext/debug/__init__.py +6 -0
  28. OpenGLContext/debug/bufferimage.py +80 -0
  29. OpenGLContext/debug/leaks.py +13 -0
  30. OpenGLContext/debug/logcontext.py +9 -0
  31. OpenGLContext/debug/logs.py +15 -0
  32. OpenGLContext/debug/state.py +329 -0
  33. OpenGLContext/displaylist.py +69 -0
  34. OpenGLContext/doinchildmatrix.py +34 -0
  35. OpenGLContext/drawcube.py +58 -0
  36. OpenGLContext/events/__init__.py +10 -0
  37. OpenGLContext/events/default_config.py +29 -0
  38. OpenGLContext/events/event.py +65 -0
  39. OpenGLContext/events/eventhandlermixin.py +214 -0
  40. OpenGLContext/events/eventmanager.py +269 -0
  41. OpenGLContext/events/fxevents.py +90 -0
  42. OpenGLContext/events/glfwevents.py +424 -0
  43. OpenGLContext/events/glutevents.py +184 -0
  44. OpenGLContext/events/inputstate.py +129 -0
  45. OpenGLContext/events/internaltime.py +161 -0
  46. OpenGLContext/events/keyboardevents.py +153 -0
  47. OpenGLContext/events/mouseevents.py +473 -0
  48. OpenGLContext/events/pygameevents.py +162 -0
  49. OpenGLContext/events/systemtime.py +12 -0
  50. OpenGLContext/events/timeeventgeneratormanager.py +40 -0
  51. OpenGLContext/events/timeevents.py +143 -0
  52. OpenGLContext/events/timer.py +170 -0
  53. OpenGLContext/events/tkevents.py +172 -0
  54. OpenGLContext/events/wxevents.py +185 -0
  55. OpenGLContext/extensionmanager.py +158 -0
  56. OpenGLContext/framecounter.py +74 -0
  57. OpenGLContext/frustum.py +135 -0
  58. OpenGLContext/glfwcontext.py +395 -0
  59. OpenGLContext/glfwinteractivecontext.py +34 -0
  60. OpenGLContext/glfwvrmlcontext.py +11 -0
  61. OpenGLContext/glutcontext.py +224 -0
  62. OpenGLContext/glutinteractivecontext.py +24 -0
  63. OpenGLContext/gluttestingcontext.py +11 -0
  64. OpenGLContext/glutvrmlcontext.py +25 -0
  65. OpenGLContext/glutvrmltestingcontext.py +48 -0
  66. OpenGLContext/hud.py +404 -0
  67. OpenGLContext/interactivecontext.py +29 -0
  68. OpenGLContext/loaders/__init__.py +1 -0
  69. OpenGLContext/loaders/base.py +84 -0
  70. OpenGLContext/loaders/cc0.py +137 -0
  71. OpenGLContext/loaders/gltf/__init__.py +71 -0
  72. OpenGLContext/loaders/gltf/accessors.py +255 -0
  73. OpenGLContext/loaders/gltf/animation.py +611 -0
  74. OpenGLContext/loaders/gltf/draco.py +166 -0
  75. OpenGLContext/loaders/gltf/environment_sky.py +416 -0
  76. OpenGLContext/loaders/gltf/loader.py +80 -0
  77. OpenGLContext/loaders/gltf/materials.py +298 -0
  78. OpenGLContext/loaders/gltf/meshes.py +292 -0
  79. OpenGLContext/loaders/gltf/samples.py +162 -0
  80. OpenGLContext/loaders/gltf/scene.py +673 -0
  81. OpenGLContext/loaders/gltf/specular_glossiness.py +154 -0
  82. OpenGLContext/loaders/gltf/textures.py +155 -0
  83. OpenGLContext/loaders/gltf/transforms.py +261 -0
  84. OpenGLContext/loaders/gltf_demos.py +511 -0
  85. OpenGLContext/loaders/hdr.py +228 -0
  86. OpenGLContext/loaders/hdri.py +83 -0
  87. OpenGLContext/loaders/loader.py +255 -0
  88. OpenGLContext/loaders/obj.py +299 -0
  89. OpenGLContext/loaders/resolver.py +536 -0
  90. OpenGLContext/loaders/tiles3d/__init__.py +9 -0
  91. OpenGLContext/loaders/tiles3d/boundingvolume.py +120 -0
  92. OpenGLContext/loaders/tiles3d/dem.py +71 -0
  93. OpenGLContext/loaders/tiles3d/fetch.py +102 -0
  94. OpenGLContext/loaders/tiles3d/foliage.py +786 -0
  95. OpenGLContext/loaders/tiles3d/frustum.py +70 -0
  96. OpenGLContext/loaders/tiles3d/geomorph.py +57 -0
  97. OpenGLContext/loaders/tiles3d/gltf_uploader.py +246 -0
  98. OpenGLContext/loaders/tiles3d/loadmanager.py +121 -0
  99. OpenGLContext/loaders/tiles3d/physics_colliders.py +78 -0
  100. OpenGLContext/loaders/tiles3d/procedural.py +355 -0
  101. OpenGLContext/loaders/tiles3d/residency.py +102 -0
  102. OpenGLContext/loaders/tiles3d/runtime.py +168 -0
  103. OpenGLContext/loaders/tiles3d/sample.py +212 -0
  104. OpenGLContext/loaders/tiles3d/scatter.py +77 -0
  105. OpenGLContext/loaders/tiles3d/screenspaceerror.py +31 -0
  106. OpenGLContext/loaders/tiles3d/tileset.py +390 -0
  107. OpenGLContext/loaders/tiles3d/traversal.py +108 -0
  108. OpenGLContext/loaders/tiles3d/vegetation.py +361 -0
  109. OpenGLContext/loaders/vrml97.py +133 -0
  110. OpenGLContext/looptrace.py +307 -0
  111. OpenGLContext/move/__init__.py +0 -0
  112. OpenGLContext/move/bindingstore.py +232 -0
  113. OpenGLContext/move/direct.py +156 -0
  114. OpenGLContext/move/dragwatcher.py +42 -0
  115. OpenGLContext/move/examinemanager.py +100 -0
  116. OpenGLContext/move/followcam.py +121 -0
  117. OpenGLContext/move/modes.py +522 -0
  118. OpenGLContext/move/movementmanager.py +74 -0
  119. OpenGLContext/move/navigation.py +137 -0
  120. OpenGLContext/move/physicsplatform.py +203 -0
  121. OpenGLContext/move/physicswalk.py +469 -0
  122. OpenGLContext/move/smooth.py +68 -0
  123. OpenGLContext/move/terrainwalk.py +451 -0
  124. OpenGLContext/move/trackball.py +92 -0
  125. OpenGLContext/move/viewplatform.py +283 -0
  126. OpenGLContext/move/viewplatformmixin.py +335 -0
  127. OpenGLContext/nav/__init__.py +13 -0
  128. OpenGLContext/nav/navmesh.py +476 -0
  129. OpenGLContext/passes/__init__.py +0 -0
  130. OpenGLContext/passes/_flat.py +1317 -0
  131. OpenGLContext/passes/asyncpick.py +216 -0
  132. OpenGLContext/passes/bloom.py +257 -0
  133. OpenGLContext/passes/flatcompat.py +246 -0
  134. OpenGLContext/passes/flatcore.py +198 -0
  135. OpenGLContext/passes/flateffects.py +372 -0
  136. OpenGLContext/passes/ibl.py +711 -0
  137. OpenGLContext/passes/instancing.py +775 -0
  138. OpenGLContext/passes/pbrpass.py +829 -0
  139. OpenGLContext/passes/renderpass.py +79 -0
  140. OpenGLContext/passes/renderstats.py +55 -0
  141. OpenGLContext/passes/rendervisitor.py +60 -0
  142. OpenGLContext/passes/selection.py +450 -0
  143. OpenGLContext/passes/selectionbuffers.py +442 -0
  144. OpenGLContext/passes/shaderpass.py +1018 -0
  145. OpenGLContext/passes/shaderpass_shadow.py +197 -0
  146. OpenGLContext/passes/shadersource.py +121 -0
  147. OpenGLContext/passes/shadowcaps.py +182 -0
  148. OpenGLContext/passes/shadowmap.py +330 -0
  149. OpenGLContext/passes/shadowmath.py +290 -0
  150. OpenGLContext/passes/shadowmixin.py +906 -0
  151. OpenGLContext/passes/shadowpool.py +186 -0
  152. OpenGLContext/passes/transmission.py +124 -0
  153. OpenGLContext/physics/__init__.py +16 -0
  154. OpenGLContext/physics/debugdraw.py +370 -0
  155. OpenGLContext/physics/demo.py +157 -0
  156. OpenGLContext/physics/gltf_world.py +185 -0
  157. OpenGLContext/physics/manager.py +84 -0
  158. OpenGLContext/physics/threaded.py +93 -0
  159. OpenGLContext/plugins.py +61 -0
  160. OpenGLContext/pygamecontext.py +178 -0
  161. OpenGLContext/pygameinteractivecontext.py +36 -0
  162. OpenGLContext/pygametestingcontext.py +10 -0
  163. OpenGLContext/pygamevrmlcontext.py +13 -0
  164. OpenGLContext/quaternion.py +190 -0
  165. OpenGLContext/renderoptions.py +280 -0
  166. OpenGLContext/resources/__init__.py +36 -0
  167. OpenGLContext/resources/available_contexts.txt +4 -0
  168. OpenGLContext/resources/available_contexts_txt.py +9 -0
  169. OpenGLContext/resources/context_icon_png.py +46 -0
  170. OpenGLContext/resources/context_icon_small_png.py +21 -0
  171. OpenGLContext/resources/disk_icon_hi_png.py +14 -0
  172. OpenGLContext/resources/disk_icon_png.py +15 -0
  173. OpenGLContext/resources/environment/pimbackground_BK.jpg +0 -0
  174. OpenGLContext/resources/environment/pimbackground_DN.jpg +0 -0
  175. OpenGLContext/resources/environment/pimbackground_FR.jpg +0 -0
  176. OpenGLContext/resources/environment/pimbackground_LF.jpg +0 -0
  177. OpenGLContext/resources/environment/pimbackground_RT.jpg +0 -0
  178. OpenGLContext/resources/environment/pimbackground_UP.jpg +0 -0
  179. OpenGLContext/resources/environment/studio_BK.jpg +0 -0
  180. OpenGLContext/resources/environment/studio_DN.jpg +0 -0
  181. OpenGLContext/resources/environment/studio_FR.jpg +0 -0
  182. OpenGLContext/resources/environment/studio_LF.jpg +0 -0
  183. OpenGLContext/resources/environment/studio_RT.jpg +0 -0
  184. OpenGLContext/resources/environment/studio_UP.jpg +0 -0
  185. OpenGLContext/resources/environment/studiobright_BK.jpg +0 -0
  186. OpenGLContext/resources/environment/studiobright_DN.jpg +0 -0
  187. OpenGLContext/resources/environment/studiobright_FR.jpg +0 -0
  188. OpenGLContext/resources/environment/studiobright_LF.jpg +0 -0
  189. OpenGLContext/resources/environment/studiobright_RT.jpg +0 -0
  190. OpenGLContext/resources/environment/studiobright_UP.jpg +0 -0
  191. OpenGLContext/resources/green_arrow_right_png.py +47 -0
  192. OpenGLContext/resources/legacy_lighting.vert.txt +37 -0
  193. OpenGLContext/resources/legacy_lighting_vert_txt.py +18 -0
  194. OpenGLContext/resources/lights.vert.txt +107 -0
  195. OpenGLContext/resources/lights_vert_txt.py +23 -0
  196. OpenGLContext/resources/phongprecalc_vert.py +30 -0
  197. OpenGLContext/resources/phongweights_frag.py +47 -0
  198. OpenGLContext/resources/pygame_icon_png.py +47 -0
  199. OpenGLContext/resources/red_arrow_right_png.py +50 -0
  200. OpenGLContext/resources/simpleshader.frag.txt +3 -0
  201. OpenGLContext/resources/simpleshader.vert.txt +3 -0
  202. OpenGLContext/resources/simpleshader_frag_txt.py +9 -0
  203. OpenGLContext/resources/simpleshader_vert_txt.py +10 -0
  204. OpenGLContext/scenegraph/__init__.py +19 -0
  205. OpenGLContext/scenegraph/appearance.py +107 -0
  206. OpenGLContext/scenegraph/arraygeometry.py +238 -0
  207. OpenGLContext/scenegraph/audio.py +632 -0
  208. OpenGLContext/scenegraph/background.py +108 -0
  209. OpenGLContext/scenegraph/basenodes.py +50 -0
  210. OpenGLContext/scenegraph/billboard.py +14 -0
  211. OpenGLContext/scenegraph/boundingvolume.py +494 -0
  212. OpenGLContext/scenegraph/box.py +180 -0
  213. OpenGLContext/scenegraph/collision.py +14 -0
  214. OpenGLContext/scenegraph/coordinate.py +20 -0
  215. OpenGLContext/scenegraph/coordinatebounded.py +18 -0
  216. OpenGLContext/scenegraph/cubebackground.py +207 -0
  217. OpenGLContext/scenegraph/extrusions.py +275 -0
  218. OpenGLContext/scenegraph/fog.py +123 -0
  219. OpenGLContext/scenegraph/gear.py +323 -0
  220. OpenGLContext/scenegraph/group.py +20 -0
  221. OpenGLContext/scenegraph/grouping.py +140 -0
  222. OpenGLContext/scenegraph/hdrbackground.py +384 -0
  223. OpenGLContext/scenegraph/ifscompiler.py +633 -0
  224. OpenGLContext/scenegraph/imagetexture.py +365 -0
  225. OpenGLContext/scenegraph/indexedfaceset.py +238 -0
  226. OpenGLContext/scenegraph/indexedlineset.py +418 -0
  227. OpenGLContext/scenegraph/indexedpolygons.py +422 -0
  228. OpenGLContext/scenegraph/inline.py +79 -0
  229. OpenGLContext/scenegraph/instancedgl.py +187 -0
  230. OpenGLContext/scenegraph/interpolators.py +122 -0
  231. OpenGLContext/scenegraph/light.py +213 -0
  232. OpenGLContext/scenegraph/lod.py +22 -0
  233. OpenGLContext/scenegraph/material.py +96 -0
  234. OpenGLContext/scenegraph/material_fields.py +50 -0
  235. OpenGLContext/scenegraph/mouseover.py +43 -0
  236. OpenGLContext/scenegraph/nodepath.py +52 -0
  237. OpenGLContext/scenegraph/nurbs.py +637 -0
  238. OpenGLContext/scenegraph/nurbssampling.py +101 -0
  239. OpenGLContext/scenegraph/nurbstess.py +316 -0
  240. OpenGLContext/scenegraph/nurbstrim.py +54 -0
  241. OpenGLContext/scenegraph/particles.py +786 -0
  242. OpenGLContext/scenegraph/pbrmaterial.py +229 -0
  243. OpenGLContext/scenegraph/pbrmesh.py +558 -0
  244. OpenGLContext/scenegraph/physicsbody.py +72 -0
  245. OpenGLContext/scenegraph/pointset.py +257 -0
  246. OpenGLContext/scenegraph/polygon.py +166 -0
  247. OpenGLContext/scenegraph/polygonsort.py +119 -0
  248. OpenGLContext/scenegraph/polygontessellator.py +213 -0
  249. OpenGLContext/scenegraph/quadrics.py +494 -0
  250. OpenGLContext/scenegraph/scenegraph.py +21 -0
  251. OpenGLContext/scenegraph/shadergeometry.py +403 -0
  252. OpenGLContext/scenegraph/shaders.py +812 -0
  253. OpenGLContext/scenegraph/shape.py +243 -0
  254. OpenGLContext/scenegraph/simplebackground.py +34 -0
  255. OpenGLContext/scenegraph/spherebackground.py +462 -0
  256. OpenGLContext/scenegraph/switch.py +75 -0
  257. OpenGLContext/scenegraph/teapot.py +439 -0
  258. OpenGLContext/scenegraph/teapot_nurbs.py +291 -0
  259. OpenGLContext/scenegraph/teapot_nurbs_data.py +384 -0
  260. OpenGLContext/scenegraph/terrain/__init__.py +12 -0
  261. OpenGLContext/scenegraph/terrain/heightfield.py +172 -0
  262. OpenGLContext/scenegraph/terrain/splat.py +224 -0
  263. OpenGLContext/scenegraph/tessellationlod.py +97 -0
  264. OpenGLContext/scenegraph/text/__init__.py +1 -0
  265. OpenGLContext/scenegraph/text/_toolsfont.py +200 -0
  266. OpenGLContext/scenegraph/text/font.py +452 -0
  267. OpenGLContext/scenegraph/text/fontprovider.py +193 -0
  268. OpenGLContext/scenegraph/text/fonts/__init__.py +75 -0
  269. OpenGLContext/scenegraph/text/fonts/font_atlas_10.py +133 -0
  270. OpenGLContext/scenegraph/text/fonts/font_atlas_12.py +158 -0
  271. OpenGLContext/scenegraph/text/fonts/font_atlas_14.py +176 -0
  272. OpenGLContext/scenegraph/text/fonts/font_atlas_16.py +204 -0
  273. OpenGLContext/scenegraph/text/fonts/font_atlas_18.py +222 -0
  274. OpenGLContext/scenegraph/text/fonts/font_atlas_20.py +244 -0
  275. OpenGLContext/scenegraph/text/fonts/font_atlas_24.py +294 -0
  276. OpenGLContext/scenegraph/text/fonts/font_atlas_28.py +339 -0
  277. OpenGLContext/scenegraph/text/fonts/font_atlas_32.py +390 -0
  278. OpenGLContext/scenegraph/text/fontstyle3d.py +62 -0
  279. OpenGLContext/scenegraph/text/glutfont.py +186 -0
  280. OpenGLContext/scenegraph/text/pygamefont.py +213 -0
  281. OpenGLContext/scenegraph/text/shaderfont.py +340 -0
  282. OpenGLContext/scenegraph/text/shadertext.py +433 -0
  283. OpenGLContext/scenegraph/text/text.py +75 -0
  284. OpenGLContext/scenegraph/text/toolsfont.py +819 -0
  285. OpenGLContext/scenegraph/text/ttfregistry.py +135 -0
  286. OpenGLContext/scenegraph/text/wglfont.py +228 -0
  287. OpenGLContext/scenegraph/text/wglfontprovider.py +37 -0
  288. OpenGLContext/scenegraph/text/wxfont.py +314 -0
  289. OpenGLContext/scenegraph/texturetransform.py +66 -0
  290. OpenGLContext/scenegraph/tilesterrain.py +95 -0
  291. OpenGLContext/scenegraph/timesensor.py +51 -0
  292. OpenGLContext/scenegraph/transform.py +180 -0
  293. OpenGLContext/scenegraph/vegetation/__init__.py +20 -0
  294. OpenGLContext/scenegraph/vegetation/base.py +96 -0
  295. OpenGLContext/scenegraph/vegetation/billboards.py +145 -0
  296. OpenGLContext/scenegraph/vegetation/clumps.py +260 -0
  297. OpenGLContext/scenegraph/vegetation/grid.py +112 -0
  298. OpenGLContext/scenegraph/vegetation/nearmesh.py +185 -0
  299. OpenGLContext/scenegraph/vertex.py +54 -0
  300. OpenGLContext/scenegraph/viewpoint.py +42 -0
  301. OpenGLContext/scenegraph/winding.py +49 -0
  302. OpenGLContext/shaders/_brdf_inc.glsl +124 -0
  303. OpenGLContext/shaders/_common_inc.glsl +24 -0
  304. OpenGLContext/shaders/_cubemap_inc.glsl +26 -0
  305. OpenGLContext/shaders/_lights_inc.glsl +32 -0
  306. OpenGLContext/shaders/_objectid_inc.glsl +14 -0
  307. OpenGLContext/shaders/_shadow_inc.glsl +254 -0
  308. OpenGLContext/shaders/_vrml97_lighting_inc.glsl +78 -0
  309. OpenGLContext/shaders/hdr_background.frag +32 -0
  310. OpenGLContext/shaders/hdr_background.vert +15 -0
  311. OpenGLContext/shaders/ibl_brdf.frag +78 -0
  312. OpenGLContext/shaders/ibl_env.frag +53 -0
  313. OpenGLContext/shaders/ibl_equirect.frag +19 -0
  314. OpenGLContext/shaders/ibl_fullscreen.vert +11 -0
  315. OpenGLContext/shaders/ibl_irradiance.frag +40 -0
  316. OpenGLContext/shaders/ibl_prefilter.frag +56 -0
  317. OpenGLContext/shaders/particle.frag +42 -0
  318. OpenGLContext/shaders/particle.vert +52 -0
  319. OpenGLContext/shaders/pbr.frag +906 -0
  320. OpenGLContext/shaders/pbr.vert +70 -0
  321. OpenGLContext/shaders/shadow_depth.frag +4 -0
  322. OpenGLContext/shaders/shadow_depth.vert +18 -0
  323. OpenGLContext/shaders/terrain_splat.frag +80 -0
  324. OpenGLContext/shaders/terrain_splat.vert +16 -0
  325. OpenGLContext/shaders/veg_billboard.frag +35 -0
  326. OpenGLContext/shaders/veg_billboard.vert +17 -0
  327. OpenGLContext/shaders/veg_clump.frag +27 -0
  328. OpenGLContext/shaders/veg_mesh.frag +26 -0
  329. OpenGLContext/shaders/veg_mesh.vert +17 -0
  330. OpenGLContext/shaders/vrml97_background.frag +17 -0
  331. OpenGLContext/shaders/vrml97_background.vert +24 -0
  332. OpenGLContext/shaders/vrml97_lighting.frag +111 -0
  333. OpenGLContext/shaders/vrml97_lighting.vert +50 -0
  334. OpenGLContext/shaders/vrml97_line.frag +23 -0
  335. OpenGLContext/shaders/vrml97_line.vert +24 -0
  336. OpenGLContext/shaders/vrml97_point.frag +36 -0
  337. OpenGLContext/shaders/vrml97_point.vert +21 -0
  338. OpenGLContext/shaders/vrml97_unlit.frag +59 -0
  339. OpenGLContext/shaders/vrml97_unlit.vert +18 -0
  340. OpenGLContext/shaders/vrml97_vertex_color.frag +85 -0
  341. OpenGLContext/shaders/vrml97_vertex_color.vert +34 -0
  342. OpenGLContext/stalltrace.py +637 -0
  343. OpenGLContext/testing/__init__.py +67 -0
  344. OpenGLContext/testing/display.py +30 -0
  345. OpenGLContext/testing/event_injector.py +564 -0
  346. OpenGLContext/testing/framebuffer_comparison.py +842 -0
  347. OpenGLContext/testing/gl_env.py +39 -0
  348. OpenGLContext/testing/paths.py +23 -0
  349. OpenGLContext/testing/process_exit.py +30 -0
  350. OpenGLContext/testing/report_generator.py +594 -0
  351. OpenGLContext/testing/subprocess_runner.py +411 -0
  352. OpenGLContext/testingcontext.py +36 -0
  353. OpenGLContext/tests/test_atlas.py +62 -0
  354. OpenGLContext/tests/test_configs.py +27 -0
  355. OpenGLContext/tests/test_polygonsort.py +45 -0
  356. OpenGLContext/tests/test_utilities.py +84 -0
  357. OpenGLContext/tests/test_viewplatform.py +39 -0
  358. OpenGLContext/texture.py +449 -0
  359. OpenGLContext/texturecache.py +37 -0
  360. OpenGLContext/triangleutilities.py +89 -0
  361. OpenGLContext/ui/__init__.py +39 -0
  362. OpenGLContext/ui/bindings.py +243 -0
  363. OpenGLContext/ui/console.py +339 -0
  364. OpenGLContext/ui/debugoverlay.py +519 -0
  365. OpenGLContext/ui/dialogs.py +124 -0
  366. OpenGLContext/ui/draw.py +617 -0
  367. OpenGLContext/ui/gallery.py +425 -0
  368. OpenGLContext/ui/generate.py +195 -0
  369. OpenGLContext/ui/geometry.py +88 -0
  370. OpenGLContext/ui/hudwidgets.py +1053 -0
  371. OpenGLContext/ui/layout.py +263 -0
  372. OpenGLContext/ui/metrics.py +218 -0
  373. OpenGLContext/ui/overlay.py +412 -0
  374. OpenGLContext/ui/panel.py +459 -0
  375. OpenGLContext/ui/pictures.py +261 -0
  376. OpenGLContext/ui/screen.py +177 -0
  377. OpenGLContext/ui/scroll.py +297 -0
  378. OpenGLContext/ui/session.py +329 -0
  379. OpenGLContext/ui/settings.py +273 -0
  380. OpenGLContext/ui/skin.py +330 -0
  381. OpenGLContext/ui/widgets.py +1199 -0
  382. OpenGLContext/userpaths.py +48 -0
  383. OpenGLContext/utilities.py +94 -0
  384. OpenGLContext/vectorutilities.py +101 -0
  385. OpenGLContext/viewer/__init__.py +60 -0
  386. OpenGLContext/viewer/adapters/__init__.py +150 -0
  387. OpenGLContext/viewer/adapters/base.py +157 -0
  388. OpenGLContext/viewer/adapters/gltf.py +31 -0
  389. OpenGLContext/viewer/adapters/obj.py +20 -0
  390. OpenGLContext/viewer/adapters/scenegraph.py +71 -0
  391. OpenGLContext/viewer/adapters/tiles.py +296 -0
  392. OpenGLContext/viewer/adapters/vrml.py +25 -0
  393. OpenGLContext/viewer/asyncscene.py +117 -0
  394. OpenGLContext/viewer/caption.py +126 -0
  395. OpenGLContext/viewer/capture.py +77 -0
  396. OpenGLContext/viewer/debug.py +78 -0
  397. OpenGLContext/viewer/environment.py +131 -0
  398. OpenGLContext/viewer/framing.py +111 -0
  399. OpenGLContext/viewer/library.py +235 -0
  400. OpenGLContext/viewer/menu.py +218 -0
  401. OpenGLContext/viewer/options.py +150 -0
  402. OpenGLContext/viewer/overlay.py +63 -0
  403. OpenGLContext/viewer/sceneviewer.py +1056 -0
  404. OpenGLContext/viewer/screens.py +172 -0
  405. OpenGLContext/viewer/source.py +56 -0
  406. OpenGLContext/visitor.py +68 -0
  407. OpenGLContext/vrmlcontext.py +72 -0
  408. OpenGLContext/wxcontext.py +424 -0
  409. OpenGLContext/wxinteractivecontext.py +25 -0
  410. OpenGLContext/wxtestingcontext.py +9 -0
  411. OpenGLContext/wxvrmlcontext.py +13 -0
  412. openglcontext-3.0.0a1.dist-info/METADATA +650 -0
  413. openglcontext-3.0.0a1.dist-info/RECORD +417 -0
  414. openglcontext-3.0.0a1.dist-info/WHEEL +5 -0
  415. openglcontext-3.0.0a1.dist-info/entry_points.txt +11 -0
  416. openglcontext-3.0.0a1.dist-info/licenses/license.txt +89 -0
  417. openglcontext-3.0.0a1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,156 @@
1
+ """Interactions for navigating the context"""
2
+ from gettext import gettext as _
3
+ from OpenGLContext.move import movementmanager
4
+ import math
5
+
6
+ class Direct( movementmanager.MovementManager ):
7
+ """OpenGLContext's original manipulation for the view platform"""
8
+ commands = movementmanager.MovementManager.commands + [
9
+ # User-name, key, function-name
10
+ (_('Forward'), 'forward','forward'),
11
+ (_('Back'), 'backward','backward' ),
12
+ (_('Up'), 'up','up' ),
13
+ (_('Down'), 'down', 'down' ),
14
+ (_('Left'), 'left', 'left' ),
15
+ (_('Right'), 'right', 'right' ),
16
+
17
+ (_('Turn Up'), 'turnup', 'turnup' ),
18
+ (_('Turn Down'), 'turndown', 'turndown' ),
19
+ (_('Turn Left'), 'turnleft', 'turnleft' ),
20
+ (_('Turn Right'), 'turnright', 'turnright' ),
21
+
22
+ (_('Straighten'), 'straighten','straighten'),
23
+
24
+ (_('Faster'), 'faster', 'faster' ),
25
+ (_('Slower'), 'slower','slower' ),
26
+ ]
27
+ commandBindings = dict(
28
+ forward=dict( eventType='keyboard', name='<up>', state=1, modifiers=(0,0,0) ),
29
+ backward=dict( eventType='keyboard', name='<down>', state=1, modifiers=(0,0,0) ),
30
+ up=dict( eventType='keyboard', name='<up>', state=1, modifiers=(0,0,1)),
31
+ turnup=dict(eventType='keyboard', name='<up>', state=1, modifiers=(0,1,0)),
32
+ turndown=dict(eventType='keyboard', name='<down>', state=1, modifiers=(0,1,0)),
33
+ down=dict(eventType='keyboard', name='<down>', state=1, modifiers=(0,0,1),),
34
+ turnleft=dict(eventType='keyboard', name='<left>', state=1, modifiers=(0,0,0),),
35
+ left=dict(eventType='keyboard', name='<left>', state=1, modifiers=(0,0,1)),
36
+ turnright=dict(eventType='keyboard', name='<right>', state=1, modifiers=(0,0,0),),
37
+ right=dict(eventType='keyboard', name='<right>', state=1, modifiers=(0,0,1),),
38
+ straighten=dict(eventType='keypress', name='-', modifiers=(0,0,0),),
39
+ slower=dict(eventType='keypress', name='[', modifiers=(0,0,0),),
40
+ faster=dict(eventType='keypress', name=']', modifiers=(0,0,0),),
41
+ examine=dict(eventType='mousebutton', button=1, state = 1, modifiers=(0,0,0),),
42
+ )
43
+ STEPDISTANCE = 0.5 # 1/2 of a unit
44
+ TURNANGLE = math.pi/32
45
+
46
+ ### LOGO-like commands...
47
+ def turn (self, deltaOrientation= (0,1,0,math.pi/4) ):
48
+ """Apply rotation within the current orientation
49
+
50
+ In essence, this allows you to "turn your head"
51
+ which gives you the commonly useful ability to
52
+ function from your own frame of reference.
53
+
54
+ For example:
55
+ turn( 1,0,0,angle ) will rotate the camera up
56
+ from its current view orientation
57
+ turn( 0,1,0,angle ) will rotate the camera about
58
+ the current horizon
59
+
60
+ This method is implemented almost entirely within
61
+ the quaternion class. Quaternion's have considerable
62
+ advantages for this type of work, as they do not
63
+ become "warped" with successive rotations.
64
+ """
65
+ self.platform.setOrientation( self.platform.relativeOrientation( deltaOrientation ) )
66
+ self.context.triggerRedraw(1)
67
+
68
+ def stepRelative( self, x=0,y=0,z=0 ):
69
+ """Step this distance in relative (view) coordinates"""
70
+ self.platform.moveRelative( x=x,y=y,z=z )
71
+ self.context.triggerRedraw(1)
72
+
73
+ def forward( self, event ):
74
+ """(callback) Move platform forward by STEPDISTANCE
75
+
76
+ triggers redraw after completion
77
+ """
78
+ self.stepRelative( z = -self.STEPDISTANCE )
79
+ def backward( self, event ):
80
+ """(callback) Move platform backward by STEPDISTANCE
81
+
82
+ triggers redraw after completion
83
+ """
84
+ self.stepRelative( z = self.STEPDISTANCE )
85
+ def up( self, event ):
86
+ """(callback) Move platform upward by STEPDISTANCE
87
+
88
+ triggers redraw after completion
89
+ """
90
+ self.stepRelative( y = self.STEPDISTANCE )
91
+ def down( self, event ):
92
+ """(callback) Move platform downward by STEPDISTANCE
93
+
94
+ triggers redraw after completion
95
+ """
96
+ self.stepRelative( y = -self.STEPDISTANCE )
97
+ def left( self, event ):
98
+ """(callback) Move platform left by STEPDISTANCE
99
+
100
+ triggers redraw after completion
101
+ """
102
+ self.stepRelative( x = -self.STEPDISTANCE )
103
+ def right( self, event ):
104
+ """(callback) Move platform right by STEPDISTANCE
105
+
106
+ triggers redraw after completion
107
+ """
108
+ self.stepRelative( x = self.STEPDISTANCE )
109
+ def turnup( self, event ):
110
+ """(callback) Rotates "head" backward (looks upward) by TURNANGLE
111
+
112
+ triggers redraw after completion
113
+ """
114
+ self.turn( (1.0,0.0,0.0, self.TURNANGLE) )
115
+ def turndown( self, event ):
116
+ """(callback) Rotates "head" forward (looks downward) by TURNANGLE
117
+
118
+ triggers redraw after completion
119
+ """
120
+ self.turn( (1.0,0.0,0.0, -self.TURNANGLE) )
121
+ def turnleft( self, event ):
122
+ """(callback) Rotates "head" to the left by TURNANGLE
123
+
124
+ triggers redraw after completion
125
+ """
126
+ self.turn( (0.0,1.0,0.0, self.TURNANGLE) )
127
+ def turnright( self, event ):
128
+ """(callback) Rotates "head" to the right by TURNANGLE
129
+
130
+ triggers redraw after completion
131
+ """
132
+ self.turn( (0.0,1.0,0.0, -self.TURNANGLE) )
133
+ def straighten( self, event ):
134
+ """(callback) Straightens the platform orientation
135
+
136
+ Attempts to make the orientation equal to the
137
+ y-axis orientation of the current orientation.
138
+
139
+ In other words, tries to make the camera's horizon
140
+ equal to the object-space horizon (the x,z plane)
141
+ without altering the y-axis orientation.
142
+
143
+ See:
144
+ OpenGLContext.viewplatform.ViewPlatform.straighten
145
+
146
+ triggers redraw after completion
147
+ """
148
+ self.platform.straighten()
149
+ self.context.triggerRedraw(1)
150
+
151
+ def faster( self, event ):
152
+ """Increase our walking speed"""
153
+ self.STEPDISTANCE *= 1.5
154
+ def slower( self, event ):
155
+ """Decrease our walking speed"""
156
+ self.STEPDISTANCE /= 1.5
@@ -0,0 +1,42 @@
1
+ """Semantics for fractional and absolute dragging"""
2
+
3
+ class DragWatcher(object):
4
+ """Class providing semantics for fractional and absolute dragging
5
+
6
+ With this class you can track the start position of a drag action
7
+ and query for both absolute distance dragged, and distance as a
8
+ fraction of the distance to the edges of the window.
9
+ """
10
+ def __init__ (self, startX, startY, totalX, totalY ):
11
+ """Initialise the DragWatcher
12
+
13
+ startX, startY -- initial coordinates for the drag
14
+ totalX, totalY -- overall dimensions of the context
15
+ """
16
+ self.start = startX, startY
17
+ self.total = totalX, totalY
18
+ def fractions (self, newX, newY ):
19
+ """Calculate fractional delta from the start point
20
+
21
+ newX, newY -- new selection point from which to calculate
22
+ """
23
+ if (newX, newY) == self.start:
24
+ return 0.0,0.0
25
+ values = []
26
+ for index, item in ((0, newX), (1, newY)):
27
+ if item < self.start[index]:
28
+ value = float(item-self.start[index])/ self.start[index]
29
+ else:
30
+ value = float(item-self.start[index])/ (self.total[index]-self.start[index])
31
+ values.append (value)
32
+ return values
33
+ def distances (self, newX, newY ):
34
+ """Calculate absolute distances from start point
35
+
36
+ newX, newY -- new selection point from which to calculate
37
+ """
38
+ if (newX, newY) == self.start:
39
+ return 0,0
40
+ else:
41
+ return newX-self.start[0], newY-self.start[1]
42
+
@@ -0,0 +1,100 @@
1
+ """Interaction mode for examining objects"""
2
+ import math
3
+
4
+ from OpenGLContext.events import eventmanager
5
+
6
+ #: How far a drag from where it started to the edge of the window turns the
7
+ #: view: **half a circle**. The trackball's own default is a full one, which
8
+ #: put the far side of the model half a window away and made a nudge a quarter
9
+ #: turn -- with nothing that could be called examining in between. Half a turn
10
+ #: to the edge is what a VRML browser has always done, and it means the whole
11
+ #: of an object is reachable in one drag while a small movement is a small look.
12
+ EXAMINE_DRAG_ANGLE = math.pi
13
+
14
+ class ExamineManager ( eventmanager.EventManager):
15
+ """Interaction EventManager for "Examine" mode
16
+
17
+ This interaction manager implements an examine mode
18
+ similar to that found in VRML97 browsers. Pointing
19
+ to an object and dragging up/down left/right causes
20
+ the viewpoint to orbit around the object as if the
21
+ object were held in the hand and being rotated.
22
+
23
+ The manager uses the trackball thereby the dragwatcher
24
+ to provide screen-relative scaling of the input. In
25
+ other words, distances are measured as fractions of
26
+ the distance to the edge of the screen.
27
+ """
28
+ type = "examine"
29
+ def __init__ (self, context, platform, center, event):
30
+ """Initialise the ExamineManager
31
+
32
+ context -- Context instance
33
+ platform -- ViewPlatform instance
34
+ center -- object-space coordinates about which to revolve
35
+ event -- event which began the examine interaction.
36
+ """
37
+ self.platform = platform
38
+ self.client = context
39
+ eventmanager.EventManager.__init__ (self)
40
+ width, height = self.client.getViewPort()
41
+ self.button = event.button
42
+ self.OnBuildTrackball( platform, center, event, width, height )
43
+ self.OnBind()
44
+ ### client API
45
+ def update( self, event ):
46
+ '''Update the examine trackball with new mouse event
47
+
48
+ This updates the internal position, then triggers a
49
+ redraw of the context.
50
+ '''
51
+ position, orientation = self.trackball.update(* event.getPickPoint() )
52
+ self.platform.position = position
53
+ self.platform.quaternion = orientation
54
+ self.client.triggerRedraw(1)
55
+ def release( self, event ):
56
+ """Trigger cleanup of the examine mode"""
57
+ self.OnUnBind()
58
+ def cancel(self, event):
59
+ """Cancel the examine mode, return to original position and orientation"""
60
+ position, orientation = self.trackball.cancel ()
61
+ self.OnUnBind()
62
+ self.platform.position = position
63
+ self.platform.quaternion = orientation
64
+ self.client.triggerRedraw(1)
65
+
66
+ ### Customisation points
67
+ def OnBuildTrackball( self, platform, center, event, width, height ):
68
+ """Build the trackball object
69
+ Customisation point for those wanting to use a different
70
+ trackball implementation."""
71
+ from OpenGLContext.move import trackball
72
+ self.trackball = trackball.Trackball (
73
+ platform.position, platform.quaternion,
74
+ center,
75
+ event.getPickPoint()[0],event.getPickPoint()[1],
76
+ width, height,
77
+ dragAngle = EXAMINE_DRAG_ANGLE,
78
+ )
79
+
80
+ def OnBind( self ):
81
+ """Bind the events needing binding to run the examine mode
82
+ Customisation point for those needing custom controls"""
83
+ self.client.captureEvents("mousebutton", self)
84
+ self.client.captureEvents("mousemove", self)
85
+ def OnUnBind( self ):
86
+ """UnBind the events for the examine mode
87
+ Customisation point for those needing custom controls"""
88
+ self.client.captureEvents("mousemove", None)
89
+ self.client.captureEvents("mousebutton", None)
90
+ def ProcessEvent (self, event):
91
+ """Respond to events from the system
92
+ Customisation point for those needing custom controls"""
93
+ if event.type == "mousemove":
94
+ self.update (event)
95
+ elif event.type == "mousebutton":
96
+ if event.button == self.button and event.state == 0: # mouse released
97
+ self.release (event)
98
+ elif event.state == 0: # mouse released, not our button, cancel
99
+ self.cancel( event )
100
+
@@ -0,0 +1,121 @@
1
+ """A fixed-offset follow camera for third-person / overhead demos.
2
+
3
+ The camera sits at a constant offset from a target and looks at it — no user
4
+ control, no orbiting. Each frame the caller sets the target (usually a moving
5
+ object's position) and calls :meth:`apply`, which writes the position and
6
+ orientation onto a :class:`~OpenGLContext.move.viewplatform.ViewPlatform`.
7
+
8
+ It also supports **holding**: freeze on the current target and ignore new ones
9
+ until released. The marble demo uses this to keep the view locked on the square a
10
+ marble fell from while the respawn penalty elapses, instead of chasing the marble
11
+ into the void.
12
+
13
+ Orientation convention: this targets the **core-profile** view path, where
14
+ ``ViewPlatform`` builds the modelview from ``modelMatrix`` /
15
+ ``quaternion.matrix``. :func:`look_at_orientation` returns the VRML axis-angle
16
+ that (after ``setOrientation`` negates it, as it does for every VRML orientation)
17
+ places the target on the camera's view -Z axis — verified end-to-end against
18
+ ``ViewPlatform.modelMatrix`` in ``tests/test_followcam.py``.
19
+ """
20
+ from typing import Any, Optional, Tuple
21
+
22
+ import numpy as np
23
+
24
+
25
+ def _normalize(v: Any) -> np.ndarray:
26
+ v = np.asarray(v, dtype='d')
27
+ n = np.linalg.norm(v)
28
+ return v / n if n > 1e-12 else v
29
+
30
+
31
+ def look_at_orientation(eye: Any, target: Any,
32
+ up: Any = (0.0, 1.0, 0.0)) -> Tuple[float, float, float, float]:
33
+ """VRML axis-angle ``(x, y, z, radians)`` orienting a camera at ``eye`` to
34
+ look at ``target``.
35
+
36
+ Builds the camera basis (right, up, backward) in world space and converts the
37
+ resulting rotation matrix to an axis-angle. ``up`` is the desired world up;
38
+ pass a different up (e.g. ``(0,0,-1)``) when looking straight down, where the
39
+ default up is degenerate.
40
+ """
41
+ eye = np.asarray(eye, dtype='d')
42
+ target = np.asarray(target, dtype='d')
43
+
44
+ backward = _normalize(eye - target) # camera local +Z
45
+ right = _normalize(np.cross(_normalize(up), backward)) # camera local +X
46
+ true_up = np.cross(backward, right) # camera local +Y
47
+ # Columns are where the camera's local x/y/z land in world space (the
48
+ # camera-local → world rotation). ViewPlatform.setOrientation negates the
49
+ # angle and the core modelMatrix consumes it so this basis becomes the view.
50
+ R = np.column_stack([right, true_up, backward])
51
+ return _matrix_to_axis_angle(R)
52
+
53
+
54
+ def _matrix_to_axis_angle(R: np.ndarray) -> Tuple[float, float, float, float]:
55
+ """Convert a 3×3 rotation matrix to VRML axis-angle ``(x, y, z, radians)``."""
56
+ trace = np.trace(R)
57
+ cos_angle = np.clip((trace - 1.0) / 2.0, -1.0, 1.0)
58
+ angle = np.arccos(cos_angle)
59
+ if angle < 1e-9:
60
+ return (0.0, 1.0, 0.0, 0.0)
61
+ if angle > np.pi - 1e-6:
62
+ # Near 180°: axis from the largest diagonal term, sign-recovered off-diagonal.
63
+ d = np.array([R[0, 0], R[1, 1], R[2, 2]])
64
+ k = int(np.argmax(d))
65
+ axis = np.zeros(3)
66
+ axis[k] = np.sqrt(max((R[k, k] + 1.0) / 2.0, 0.0))
67
+ other = [(k + 1) % 3, (k + 2) % 3]
68
+ for j in other:
69
+ axis[j] = R[k, j] / (2.0 * axis[k]) if axis[k] > 1e-9 else 0.0
70
+ axis = _normalize(axis)
71
+ return (float(axis[0]), float(axis[1]), float(axis[2]), float(angle))
72
+ axis = np.array([R[2, 1] - R[1, 2],
73
+ R[0, 2] - R[2, 0],
74
+ R[1, 0] - R[0, 1]])
75
+ axis = _normalize(axis)
76
+ return (float(axis[0]), float(axis[1]), float(axis[2]), float(angle))
77
+
78
+
79
+ class FollowCamera:
80
+ """Drive a ``ViewPlatform`` to a fixed offset from a target, looking at it."""
81
+
82
+ def __init__(self, platform: Any, offset: Any = (0.0, 14.0, 14.0),
83
+ up: Any = (0.0, 1.0, 0.0)) -> None:
84
+ self.platform = platform
85
+ self.offset = np.asarray(offset, dtype='d')
86
+ self.up = np.asarray(up, dtype='d')
87
+ self._target = np.zeros(3)
88
+ self._held_target: Optional[np.ndarray] = None
89
+
90
+ def target(self, position: Any) -> None:
91
+ """Record the live point to follow.
92
+
93
+ Always updates the live target; while holding, :meth:`apply` simply
94
+ ignores it, so on :meth:`release` the camera snaps to the most recent
95
+ live target rather than a stale one.
96
+ """
97
+ self._target = np.asarray(position, dtype='d')[:3]
98
+
99
+ def hold(self) -> None:
100
+ """Freeze the camera on the current target until :meth:`release`."""
101
+ if self._held_target is None:
102
+ self._held_target = self._target.copy()
103
+
104
+ def release(self) -> None:
105
+ """Resume following live targets."""
106
+ self._held_target = None
107
+
108
+ @property
109
+ def is_holding(self) -> bool:
110
+ return self._held_target is not None
111
+
112
+ @property
113
+ def active_target(self) -> np.ndarray:
114
+ return self._held_target if self._held_target is not None else self._target
115
+
116
+ def apply(self) -> None:
117
+ """Write the camera pose onto the platform for this frame."""
118
+ target = self.active_target
119
+ eye = target + self.offset
120
+ self.platform.setPosition(tuple(eye))
121
+ self.platform.setOrientation(look_at_orientation(eye, target, self.up))