Changes between Version 2 and Version 3 of GraphicsAPI


Ignore:
Timestamp:
Nov 7, 2014, 6:28:49 PM (11 years ago)
Author:
Tom Goddard
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GraphicsAPI

    v2 v3  
    1717These 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.
    1818
    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.
     19== Private OpenGL classes ==
     20
     21The 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. All the OpenGL is in one file graphics/opengl.py wrapped to make the OpenGL use more object oriented.  No other code directly makes OpenGL calls.
     22
     23== Complexity ==
    2024
    2125The 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).
     
    2529To 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.
    2630
     31 == Dependencies ==
     32
    2733The 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.
     34
     35== WebGL ==
     36
     37None of the Hydra graphics API was developed with retargeting to WebGL with a client (web browser) / server model.