summaryrefslogtreecommitdiffstats
path: root/experimental/webgl/helloqt.html
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-05-08 13:02:52 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-05-08 15:18:22 +0300
commitb4d7fcff38b1fde45a22e8e977a6c356376b218b (patch)
treec7f1c4d74d3de95d935bfc81cdf5c89b9e44b5f3 /experimental/webgl/helloqt.html
parent3e8d4a6e8d1cf557d923c130bb270a63321a1f53 (diff)
Add webgl demo
To be integrated into some browser demonstration. Works relatively well on quicknanobrowser on the iMX6 (eLinux) The frame rate is not very high but it is fully usable and doesn't look bad. Hint: use the touchscreen to move the spotlight's target. Three.js is MIT licensed Change-Id: I7c2e8626ebd5a39c84ea90e38efad51263c594b9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
Diffstat (limited to 'experimental/webgl/helloqt.html')
-rw-r--r--experimental/webgl/helloqt.html48
1 files changed, 48 insertions, 0 deletions
diff --git a/experimental/webgl/helloqt.html b/experimental/webgl/helloqt.html
new file mode 100644
index 0000000..56c336c
--- /dev/null
+++ b/experimental/webgl/helloqt.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
+ <style>
+ body {
+ margin: 0px;
+ overflow: hidden;
+ }
+ canvas {
+/* -webkit-transform: scale3d(2.0, 2.0, 1.0);
+ -webkit-transform-origin: 0 0 0;
+ -moz-transform: scale3d(2.0, 2.0, 1.0);
+ -moz-transform-origin: 0 0 0;*/
+ }
+ </style>
+ </head>
+
+ <body>
+ <div id="container"></div>
+ <script src="three.min.js"></script>
+ <script id="vsChecker" type="x-shader/x-vertex">
+varying vec2 vUv;
+void main()
+{
+ vUv = uv;
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
+}
+ </script>
+ <script id="fsChecker" type="x-shader/x-fragment">
+varying vec2 vUv;
+uniform float dy;
+void main()
+{
+ vec3 c = vec3(0.0);
+ float x = 4.0 * vUv.x;
+ float y = 4.0 * vUv.y + dy;
+ if (fract(x) > 0.5 ^^ fract(y) > 0.5)
+ c = vec3(1.0);
+ gl_FragColor = vec4(c, 1.0);
+}
+ </script>
+ <script src="qtlogo.js"></script>
+ <script src="helloqt.js"></script>
+ </body>
+
+</html>