diff --git a/README.md b/README.md index ecca281..3515a18 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,6 @@ Some basic ideas: * Node extends Spatial * Mesh extends Node * Nodes can contain child nodes and they inherit their parents transformation. + +See doc/usage.txt for usage infos. + diff --git a/doc/usage.txt b/doc/usage.txt index 88046fb..7451723 100644 --- a/doc/usage.txt +++ b/doc/usage.txt @@ -1,8 +1,9 @@ create a new Dart web project, add this as a pubspec.yaml dependency: dependencies: - ChronosGL: any + chronosgl: any +(The package name has switched to all lowercase!) create a HTML page and add a canvas similar to this: @@ -12,8 +13,8 @@ in your dart file add this: import 'package:chronosgl/chronosgl.dart'; void main() { - ChronosGL chronosGL = new ChronosGL('#webgl-canvas', false); - ShaderProgram prg = chronosGL.createProgram( 'FixedVertexColor', chronosGL.getShaderLib().createFixedVertexColorShader()); + ChronosGL chronosGL = new ChronosGL('#webgl-canvas'); + ShaderProgram prg = chronosGL.createProgram( createDemoShader()); Camera camera = chronosGL.getCamera(); camera.setPos( 0.0, 0.0, 56.0 ); Mesh m = chronosGL.getUtils().createTorusKnotMesh(); @@ -21,10 +22,12 @@ void main() { chronosGL.run(); } +Press play to test. + If you need dart:html, it is recommended to add dart:html as HTML like this, due to a naming conflict regarding Node: import 'dart:html' as HTML; -Some other useful imports: +Some other imports you might find useful: import 'dart:web_gl'; import 'dart:math' as Math;