File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -31,3 +31,6 @@ Some basic ideas:
3131* Node extends Spatial
3232* Mesh extends Node
3333* Nodes can contain child nodes and they inherit their parents transformation.
34+
35+ See doc/usage.txt for usage infos.
36+
Original file line number Diff line number Diff line change 11
22create a new Dart web project, add this as a pubspec.yaml dependency:
33dependencies:
4- ChronosGL : any
4+ chronosgl : any
55
6+ (The package name has switched to all lowercase!)
67
78create a HTML page and add a canvas similar to this:
89<body style="height:100%; margin: 0; padding: 0">
@@ -12,19 +13,21 @@ in your dart file add this:
1213import 'package:chronosgl/chronosgl.dart';
1314
1415void main() {
15- ChronosGL chronosGL = new ChronosGL('#webgl-canvas', false );
16- ShaderProgram prg = chronosGL.createProgram( 'FixedVertexColor', chronosGL.getShaderLib().createFixedVertexColorShader ());
16+ ChronosGL chronosGL = new ChronosGL('#webgl-canvas');
17+ ShaderProgram prg = chronosGL.createProgram( createDemoShader ());
1718 Camera camera = chronosGL.getCamera();
1819 camera.setPos( 0.0, 0.0, 56.0 );
1920 Mesh m = chronosGL.getUtils().createTorusKnotMesh();
2021 prg.add( m);
2122 chronosGL.run();
2223}
2324
25+ Press play to test.
26+
2427If you need dart:html, it is recommended to add dart:html as HTML like this, due to a naming conflict regarding Node:
2528import 'dart:html' as HTML;
2629
27- Some other useful imports:
30+ Some other imports you might find useful :
2831
2932import 'dart:web_gl';
3033import 'dart:math' as Math;
You can’t perform that action at this time.
0 commit comments