Changes between Version 1 and Version 2 of GraphicsAPI
- Timestamp:
- Nov 7, 2014, 6:23:24 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GraphicsAPI
v1 v2 15 15 * Motion_Blur 16 16 17 These classes handle representing the scene, rendering it, and selecting parts of it. The "scene graph" is the geometric shapes, colors and transparency including hierarchy and instancing, al l handled by the Drawing class. A Drawing can have any number of child Drawings, to any depth, in a tree. Some classes handle the rendering (View, Camera, Lighting, Cross_Fade, Motion_Blur) including effects like silhouette edges, shadows, cross fades, and also camera modes like mono, shutter glasses stereo, or oculus rift.Selecting objects using a mouse click is handled by View and Drawing.17 These classes handle representing the scene, rendering it, and selecting parts of it. The "scene graph" is the geometric shapes, colors and transparency including hierarchy and instancing, also including the concept of selected part, all handled by the Drawing class. A Drawing can have any number of child Drawings, to any depth, in a tree. Some classes handle the rendering (View, Camera, Lighting, Cross_Fade, Motion_Blur) including effects like silhouette edges, shadows, ambient occlusion, depth cuing, cross fades, and also camera modes like mono, shutter glasses stereo, or oculus rift. Also image save including supersampling, the graphics redraw loop, and interactive center of rotation are managed by View. Selecting objects using a mouse click is handled by View and Drawing. 18 18 19 19 The Hydra graphics module also has many private classes like Render, Shader, Framebuffer, Bindings, ... that are lower level OpenGL Python classes. Those are not used outside the graphics module currently. 20 20 21 The API classes above have a total of about 170 methods and there are about 110 private methods and functions. I didn't make a distinction between private and public methods so maybe many of those 170 methods of public classes are in fact private. The public classes also have many attributes (maybe 50 total) that are public in the current Hydra design. So this graphics module is pretty complex (3400 lines of Python, 280 lines of OpenGL shader code).21 The public API classes above have a total of about 170 methods and there are about 110 private methods and functions. I didn't make a distinction between private and public methods so maybe many of those 170 methods of public classes are in fact private. The public classes also have many attributes (maybe 50 total) that are public in the current Hydra design. So this graphics module is pretty complex (3400 lines of Python, 280 lines of OpenGL shader code). 22 22 23 23 A first step to see how much complexity there is in the public interfaces is to mark all the private methods with leading underscores. 24 24 25 25 To get a uniform style some decision should be made about when public class attributes (or properties) are used and when methods are used. It is a mish mash in Hydra. 26 27 The Hydra graphics module depends on matrix and vector math provided the geometry module. The main geometry object is a Place which is a coordinate frame (origin position and 3 axis vectors). Points and vectors are simply numpy arrays. The graphics module depends on numpy, pyopengl, math, but no Hydra modules besides geometry and map_cpp. The map_cpp module is C++ used to accelerator some numpy operations, currently just 3, intercept under a mouse click for picking, hiding mesh edges, and blending images. These routines are in map_cpp which has about 100 routines for density map operations because I was too lazy to make a separate C++ module for these graphics operations.