项目作者: josefK128

项目描述 :
declarative angularjs webGL-svg-css3D framework
高级语言: JavaScript
项目地址: git://github.com/josefK128/dome.git
创建时间: 2016-05-14T14:28:12Z
项目社区:https://github.com/josefK128/dome

开源协议:

下载


dome

  • declarative i3d and animation using state-based declarative composition
    and cinematography
  • Each scene change (i3d, i2d, html-css-video, ui, cinematography) represented
    and executed as a url-component
  • URL = sequence of six template:model tuples (scene, i3d, i2d, html-css-video, ui, cinematography)
  • generative metaform based interactive 3D and VR environment for production and performance
  • declarative action based production score and interactive shot ‘overdub’
  • input assertion guards, live injected unit-test and performance tuned e2e-test

installation and setup:

  • git clone https://github.com/josefK128/dome.git
  • (optional) npm install (for dev libs/server only - runtime libs in app/libs)
  • (possibly) edit index.html - if clone is not to the server $DocumentRoot
    then the path from the $DocumentRoot to index.html must be substituted for
    the original base href shown below:

    <base href="/dome/app/"></base>

    The current base href works iff the repo is cloned directly into the http
    server $DocumentRoot. In other cases, if the clone is made instead into
    $DocumentRoot/tmp/webgl for example, then the base-href should be edited:

    <base href="/tmp/webgl/dome/app/"></base>

  • alternatively superset application can be run from the i3Dmedia.org server:
    http://i3Dmedia.org/meta-y/app/index.html

documentation:

  • for full source and example documentation refer to the Wiki

    • github.com/josefK128/metaforms-wiki
  • generate docco source-code comments (gulp docco)

declarative programming model

The system is based on declarative coding. The following is a detailed view
of an inherently procedural particle system recast in declarative form using
an angular directive which is realized via an svg-webgl template
(app/views/templates/i3d/lists/particlesystems.i3d.html)

  1. <!-- particlesystems.i3d -->
  2. <script type="text/ng-template" id="particlesystems.i3d">
  3. <i3d:particlesystem ng-repeat="(id,node) in i3d.actors.particlesystems"
  4. id={{id}}
  5. form={{node.form}}
  6. transform={{node.transform}}
  7. children={{node.children}}>
  8. <ng-include src="'children.i3d'">
  9. </i3d:particlesystem>
  10. </script>

and a model (app/scripts_es6/models/i3d/i3d-simple/simple_ps_sph_phong.js)

  1. particlesystems: {
  2. ps_phong: {form: {type: "'particlesystem.i3d'",
  3. maxParticles: 10000,
  4. textureUrl: 'images/p2.jpg',
  5. options: {
  6. positionRandomness: 1.3,
  7. velocity: [1.0, 1.0, 1.0],
  8. velocityRandomness: 1.5,
  9. size: 15,
  10. sizeRandomness: 1.0,
  11. color: '0xaa88ff',
  12. colorRandomness: 0.2,
  13. turbulence: 1.0,
  14. lifetime: 2
  15. },
  16. spawnerOptions: {
  17. spawnRate: 100,
  18. horizontalSpeed: 1.5,
  19. verticalSpeed: 3.33,
  20. timeScale: 1
  21. }
  22. },
  23. transform: {t: [0.0,-50.0,0.0]},
  24. children:{}
  25. }//ps_phong
  26. }//particlesystems
  • This approach allows the detailed characteristics of the particle system
    (16 adjustable parameters) to be specified declaratively. Declarative webGL
    is more comprehensible changeable and maintainable than procedural code which
    quickly grows out of control and is not readily understood. Further,
    declarative code is more simple to use for beginning programmers and
    inexperienced framework users, or even non-programmer artists.

ui and camera

  • The ui layer on the top left is, in this case, the same for all scenes. The top
    display is overall fps. It can be toggled on/off with the ‘hidefps’ button below.
    The rest of the ui can also be hidden using the ‘ui’ button’ which toggles
    on/off the non-fps ui. The ‘scene’ button toggles on/off the scene name bar
    which changes color for internal monitoring of state (and can be ignored).
    The scene buttons are used to change between scenes, but as mentioned above,
    the GPUParticleSystem GUI does not disappear on scene change since it is not
    placed on a specific subview layer, so the recommended scene traversal after
    the once-displayed opening is, ‘head’ followed by ‘cubenado’ - or else straight
    to ‘cubenado’.

  • The controls section has buttons ‘home’ and ‘center’ which return the camera3d
    to its initial position and zoom (home), and initial position only (cntr).
    The camaera3d is briefly explained in the next section. Other controls are:

    • hide2Daxes - toggles off/on the 2d svg axes markers which extend to a huge
      area about 400 times larger than the area in the viewport. For simplicity
      no use is made of the i2d svg layer or camera2d
    • hide2d - toggles off/on all of the i2d layer (not used, as mentioned)
    • hidebase - toggles off/on the html/css/css3d/video layer (only used
      trivially in the ‘head’ scene to show a ui-grid (for no reason)
    • hidefps - (mentioned above)
    • hide3d - toggles off/on the i3d webgl layer
  • The camera3d is initially located on the equatorial plane on the positive
    z-axis (RHS) on the surface of an origin-centered sphere which is shown as a
    blue wireframe. The wireframe can be hidden/shown by toggling the ‘csph’ button.
    The camerasphere has an attached lights apparatus positioned and implemented
    according to the model for the camerasphere-template (again, following a
    declarative methodology for scene object specification and composition).
    The lights in this case are a canonical ‘key’, ‘fill’, ‘back’ triple with
    appropriate positions, intensities and colors (which are all specifiable in
    the particular model chosen). The ‘key’ ‘fill’ and ‘back’ buttons toggle off/on
    the respective light in the apparatus.

The camera also has key controls such as:

  • arrows for pan (L-R) and tilt (Up-Down)
  • alt-g for clockwise camera rotation around the y-axis
  • alt-h for ccw
  • alt-j for clockwise rotation around the x-axis
  • alt-k for ccw
  • alt-a for dolly-z in
  • alt-s for dolly-z out
  • more at wiki: https://github.com/josefK/metaweb-wiki/wiki (interactive
    cameras, as well as further docs about the media framework)
  • note that some key combinations may now conflict with browser functions
    and that I am working on an enhanced interactive controller via new means
    to correct and possibly replace the keyboard controls.
note
  • metaweb/meta-web/dome framework copyright mark rudolph 2015