-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
149 lines (141 loc) · 7.81 KB
/
index.html
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title>Monkeybrush</title>
<!-- CSS -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Slab:700|PT+Serif:400,400italic,700,700italic" type="text/css">
<link rel="stylesheet" href="./public/css/non-essentials.css" />
<link rel="canonical" href="http://qwtel.com/hydejack/" />
<style> *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html,body{margin:0;padding:0}html{line-height:1.65}body{color:#515151;background-color:#fff}a{text-decoration:none}img{display:block;max-width:100%;margin:0 0 1rem}h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:600;line-height:1.25;color:#313131;text-rendering:optimizeLegibility}h1{font-size:2rem}h2{margin-top:1rem;font-size:1.5rem}p{margin-top:0;margin-bottom:1rem}ul,ol,dl{margin-top:0;margin-bottom:1rem}hr{position:relative;margin:1.5rem 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}.lead{font-size:1.25rem;font-weight:300}.container{max-width:38rem;padding-left:1rem;padding-right:1rem;margin-left:auto;margin-right:auto}.page-title,.post-title{color:#303030}.page-title,.post-title{margin-top:0}.post-date{display:block;margin-top:-.25rem;margin-bottom:1rem;color:#9a9a9a;font-weight:bold}.related{padding-top:2rem;padding-bottom:2rem}.related-posts{padding-left:0;list-style:none}.related-posts>h3{margin-top:0}.related-posts>li a{font-weight:normal}.message{margin-bottom:1rem;padding:1rem;color:#717171;background-color:#f9f9f9;margin-left:-1rem;margin-right:-1rem}@media (min-width: 48em){html{font-size:16px}}@media (min-width: 58em){html{font-size:18px}}.sr-only{display:none}.backdrop{display:none}.sidebar{position:relative;z-index:4;padding:2rem 1rem;color:rgba(255,255,255,0.75);background-color:#202020;text-align:left;min-height:100vh;background-size:cover;background-position:center center}.sidebar a{color:#fff}.sidebar ul{list-style:none;padding-left:0}.sidebar-sticky{position:absolute;right:1rem;bottom:1rem;left:1rem}.sidebar-about>h1{color:#fff;font-size:2rem}.sidebar-nav-item{font-weight:bold;display:block;line-height:1.75;padding:.25rem .1rem;border-top:1px solid rgba(255,255,255,0.23)}.sidebar-social>ul{min-height:3.5rem}@media (min-width: 48em){.sidebar{position:fixed;top:0;left:0;bottom:0;width:18rem}}.menu{display:block;position:absolute;top:0;left:0;padding:1.25rem 1rem;color:#9a9a9a;z-index:2}@media (min-width: 48em){.menu{display:none}}.content{padding-top:4rem;padding-bottom:4rem}@media (min-width: 48em){.content{max-width:38rem;margin-left:20rem;margin-right:2rem;border-left:none}}@media (min-width: 64em){.content{margin-left:22rem;margin-right:4rem}}.me{float:right}</style>
<style> html { font-family: "PT Serif", Georgia, serif; } :focus { outline-color: #A85641; } .font-accent { font-family: "Roboto Slab", "PT Serif", Georgia, serif; } .content a, .related-posts li a:hover { color: #A85641; } ::selection { color: #fff; background: #A85641; } ::-moz-selection { color: #fff; background: #A85641; } .sidebar { background-image: url('/hydejack/public/img/nap.jpg'); }</style>
<!-- Icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="./favicon.ico">
<link rel="shortcut icon" href="./favicon.ico">
<!-- RSS -->
<link rel="alternate" type="application/atom+xml" title="Hydejack" href="http://qwtel.com/hydejack/atom.xml">
</head>
<body>
<main class="content container">
<article id="post-2016/03/08/introducing-hydejack" class="post">
<h1 class="post-title">
<a href="./index.html">
Introducing MonkeyBrush
</a>
</h1>
<hr/>
<p>Developed by <a href="https://github.com/maldicion069" target="_blank"><code class="highlighter-rouge">@maldicion069</code></a>, MonkeyBrush is a <a href="https://www.typescriptlang.org/" target="_blank">Typescript</a> based library for creating scenes based on WebGL using OOP.</p>
<p>Because of its design, MonkeyBrush allows an almost native access to calls WebGL.</p>
<p>Features include:</p>
<ul>
<li>OOP to WebGL2.</li>
<li>It´s free!</li>
</ul>
</article>
<hr/>
<article id="simple-scene" class="scene">
<h1>Simple scene</h1>
<div class="language-ts highlighter-rouge"><pre class="highlight"><code>
let SimpleConfig = function() {
return {
resume: true
};
};
class MyScene extends MB.App {
protected homePoint = new MB.Vect3(-2.7, -1.4, 11.8);
protected camera = new MB.Camera2(this.homePoint);
protected cubito: MB.Drawable;
protected view: MB.Mat4;
protected projection: MB.Mat4;
protected identityMatrix: MB.Mat4 = MB.Mat4.identity.clone();
protected model = new MB.Mat4();
protected angle = 0;
constructor() {
super(SimpleConfig(), "App", 2);
}
protected mainShader: string = "prog";
loadAssets() { }
initialize() {
this.cubito = new MB.models.Cube(15.0);
MB.resources.ProgramManager.addWithFun("prog", (): MB.Program => {
let prog: MB.Program = new MB.Program();
prog.addShader("shaders/demoShader.vert",
M.ctes.shader_type.vertex, MB.ctes.mode.read_file);
prog.addShader("shaders/demoShader.frag",
MB.ctes.shader_type.fragment, MB.ctes.mode.read_file);
prog.compile();
prog.use();
prog.addUniforms(["projection", "view", "model"]);
return prog;
});
this.cameraUpdate();
}
update(dt: number) {
this.camera.timeElapsed = MB.Timer.deltaTime() / 10.0;
this.camera.update(this.cameraUpdate.bind(this));
this.angle += MB.Timer.deltaTime() * 0.001;
}
draw(dt?: number) {
MB.Core.getInstance().clearColorAndDepth();
let prog = MB.ProgramManager.get(this.mainShader);
prog.use();
this.model =
this.identityMatrix.clone()
.translate(new MB.Vect3(i * 1.0, j * 1.0, k * 1.0))
.rotate(90.0 * Math.PI / 180, MB.Vect3.yAxis)
.rotate(this.angle * 0.5 * dd, MB.Vect3.yAxis)
.scale(new MB.Vect3(0.25, 0.25, 0.25));
prog.sendUniformMat4("model", this.model);
this.cubito.render();
this.skybox.render(this.view, this.projection);
}
public pos = 0;
cameraUpdate() {
let canvas = MB.Core.getInstance().canvas();
this.view = this.camera.GetViewMatrix();
this.projection = this.camera.GetProjectionMatrix(canvas.width, canvas.height);
let prog = MB.resources.ProgramManager.get(this.mainShader);
prog.use();
prog.sendUniformVec3("viewPos", this.camera.GetPos());
prog.sendUniformMat4("projection", this.projection);
prog.sendUniformMat4("view", this.view);
}
textCB(gui: dat.GUI) { }
};
window.onload = () => {
new MyScene().start();
};
</code></pre>
</div>
</article>
</main>
<div id="_backdrop" class="backdrop"></div>
<a id="_menu" class="menu" href="#_sidebar">☰</a>
<aside id="_sidebar" class="sidebar" style="background-image:url('./public/img/monkey-baby-02.jpg')">
<div class="container sidebar-sticky">
<div class="sidebar-about">
<h1 class="font-accent"><a href="./index.html">MonkeyBrush</a></h1>
<p>Object oriented programming for WebGL2 applications.</p>
</div>
<nav class="sidebar-nav font-accent">
<ul>
<li>
<a class="sidebar-nav-item" href="">Introduction</a>
</li>
<li>
<a class="sidebar-nav-item" href="./demos.html" target="_link">Demos</a>
</li>
<li>
<a class="sidebar-nav-item" href="./doc/index.html" target="_link">Doc</a>
</li>
</ul>
</nav>
<div class="sidebar-social" style="text-align: center">
<a href="https://github.com/maldicion069/monkeybrush.js" target="_link"><span class="icon-github"></span></a>
</div>
</div>
</aside>
<script src="./public/js/hydejack.js" async></script>
</body>
</html>