diff --git a/doc/tech.md b/doc/tech.md index 4975176..d19ffc8 100644 --- a/doc/tech.md +++ b/doc/tech.md @@ -7,6 +7,7 @@ The intial modest outline for bootstrapping dyna3 is as follows: - dyna3 will be an npm project, but as it runs entirely client-side, there's no initial concern for being able to run under Node.js. However, npm will be useful as a dependency manager and build tool - The package will build into a top-level site/directory, which will contain all and only the files that must be on a server to deliver dyna3 to a client browser. Everything in site/ will generated from the package files; nothing in site/ will be committed to the repository. Right now the planned contents a of site/ are just a handful of top-level files, the modules/ directory for in-package javascript, the /doc directory for generated documentation, and a copy of the node_modules/ directory as a backup for the external dependencies. - Literate coffeescript modules (in the src/modules directory except for the top-level application) will compile into individual js modules in the site/modules directory (again, except for the top-level application) +- Why coffeescript? The motivation for the javascript family of languages is wide deployability and availability of numerous libraries; the motivation for coffeescript is that it (still) reduces the amount of punctuation and extraneous characters from Javascript, resulting in better readability. And Literate coffeescript so that the manual and code are co-located. - The list of external modules will be harvested from npm, automatically generating a site/modules/externals.js from which specific external items can be imported into the local modules. Within externals.js, modules will be imported from the appropriate CDN, with a fallback to a copy in site/node_modules/ for when the CDN is off line. - All modules will use ES Modules syntax/format for imports. - index.html will be minimal, perhaps containing just a title, and maybe a link to generated documentation in the site/doc directory. All of the modules will create the DOM elements needed to display themselves on the fly. @@ -15,5 +16,5 @@ The intial modest outline for bootstrapping dyna3 is as follows: Specific packages/implementation approaches for components of dyna3 will include: - For WebGL rendering of the 3D view of the geometry, the three package from npm. + - For test harness for the package: QUnit -- \ No newline at end of file diff --git a/src/dyna3.litcoffee b/src/dyna3.litcoffee new file mode 100644 index 0000000..8a82d3e --- /dev/null +++ b/src/dyna3.litcoffee @@ -0,0 +1,27 @@ +## A Brief Tour of dyna3 + +When you load dyna3, you should initially see a three-dimensional coordinate system with labeled axes. +```javascript + + import {threeLoaded, three as J3} from './externals.js' + + main = () -> + renderer = new J3.WebGLRenderer() + rwd = window.innerWidth + rht = window.innerHeight + renderer.setSize(rwd, rht) + document.body.appendChild renderer.domElement + + scene = new J3.Scene() + geometry = new J3.SphereBufferGeometry(1, 5, 5) + material = new J3.MeshBasicMaterial( {color: 0x0000ff} ) + ball = new J3.Mesh(geometry, material) + scene.add ball + + camera = new J3.PerspectiveCamera(75, rwd/rht, 0.1, 1000) + camera.position.z = 5 + + renderer.render(scene, camera) + + threeLoaded.then(main) +``` diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..0a5fa60 --- /dev/null +++ b/src/index.html @@ -0,0 +1,11 @@ + + + + + dyna3 + + + + + +