"deep structure"
Bootstrap 3.0.0 Snippet by harunpehlivan

1
2
3
4
5
6
7
8
9
10
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row">
<h2>Create your snippet's HTML, CSS and Javascript in the editor tabs</h2>
</div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
body, html {
touch-action: none;
content-zooming: none;
position: absolute;
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
canvas {
position: absolute;
display: block;
width: 100%;
height: 100%;
background:#000;
cursor: pointer;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"use strict";
{
const webgl = {
init() {
// create webGL canvas context
this.elem = document.createElement("canvas");
document.body.appendChild(this.elem);
const options = { alpha: false };
const gl = this.gl = this.elem.getContext('webgl', options) || this.elem.getContext('experimental-webgl', options);
// set shaders
this.vertexShader = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(
this.vertexShader,
`
uniform mat4 camProj, camView, modelMatrix;
attribute vec3 aPosition, aNormal, aColor;
varying vec3 vWPosition, vPosition, vNormal, vColor;
void main(void) {
vec4 mpos = modelMatrix * vec4(aPosition, 1.0);
vec4 wpos = camView * mpos;
vPosition = wpos.xyz;
vWPosition = mpos.xyz;
vNormal = aNormal;
vColor = aColor;
gl_Position = camProj * wpos;
}
`
);
this.fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(
this.fragmentShader,
`
precision highp float;
varying vec3 vWPosition, vPosition, vNormal, vColor;
const vec3 lightPos = vec3(0.0, 0.0, -2.5);
const vec3 lightColor = vec3(1.3, 1.3, 0.9);
const vec3 ambientFar = vec3(0.05, 0.1, 0.6);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: