-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
494 lines (466 loc) · 26.9 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
<!DOCTYPE html>
<html>
<head>
<title>voxc.js</title>
<link rel="icon" href="resources/images/favicon.png">
<link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Overpass|Roboto+Condensed" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.6.0/themes/prism-okaidia.css">
<script src="https://use.fontawesome.com/727ae44ffb.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/ace.js"></script>
<script src="js/monokai.js" type="text/javascript" charset="utf-8"></script>
<script src="js/mode-json.js" type="text/javascript" charset="utf-8"></script>
<!-- Latest compiled and minified Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css"/>
<!-- voxc.js required scripts -->
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="build/voxc.js" type="text/javascript" charset="utf-8"></script>
<script src="js/three.min.js" type="text/javascript" charset="utf-8"></script>
<script src="build/Test.js" type="text/javascript" charset="utf-8"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body onload="loadVoxelMain()" class="main" id="bodySection" >
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#bodySection">voxc.js</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li><a href="#documentsSection">Documentation</a></li>
<li><a href="#demoSection">Demo</a></li>
<li><a href="#aboutSection">About</a></li>
<li><a href="#usageSection">Usage</a></li>
<li><a href="converter1.html">.obj to Array</a></li>
<li><a href="converter2.html">Rule Applyer</a></li>
<li><a href="mriscan.html">Image to Array</a></li>
</ul>
</div>
</div>
</nav>
<div class="row">
<div class="col-sm-12 body">
<div class="parallax">
<div class="parallax__layer parallax__layer__1">
<img src="resources/images/parallax/1-01.png" />
</div>
<div class="parallax__layer parallax__layer__2">
<img src="resources/images/parallax/2-01.png" />
</div>
<div class="parallax__layer parallax__layer__3">
<img src="resources/images/parallax/3-01.png" />
</div>
<div class="parallax__layer parallax__layer__4">
<img src="resources/images/parallax/4-01.png" />
</div>
<div class="parallax__layer parallax__layer__5">
<img src="resources/images/parallax/5-01.png" />
</div>
<div class="parallax__layer parallax__layer__6">
<img src="resources/images/parallax/logo-01.png" />
</div>
<div class="parallax__cover">
<div class="row">
<div id="documentsSection" class="documents">
<div class="documents-heading col-sm-6 col-sm-offset-3">
<h2 class="section-heading">Documentation</h2>
<hr class="norm-hr"/>
</div>
<div class="documents-download-links col-sm-8 col-sm-offset-2">
<div class="document-link-container col-sm-4">
<a href="Documents/User Manual/usermanual.pdf">
<i class="fa fa-question-circle" aria-hidden="true"></i>
</a>
<h4 class="document-link-heading">User Manual</h4>
</div>
<div class="document-link-container col-sm-4">
<a href="Documents/Test Reports/Test report.pdf">
<i class="fa fa-bug" aria-hidden="true"></i>
</a>
<h4 class="document-link-heading">Testing Report</h4>
</div>
<div class="document-link-container col-sm-4">
<a href="Documents/Requirements Specification/requirementsspecification.pdf">
<i class="fa fa-file-text" aria-hidden="true"></i>
</a>
<h4 class="document-link-heading">SRS</h4>
</div>
</div>
</div>
</div>
<div class="youtube">
<iframe width="1300" height="800" src="https://www.youtube.com/embed/bCuYaOyAXR4" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
<!-- <div class="voxc-image"></div> -->
<!-- <img width="100%" src="resources/images/geometry3.png"/> -->
<div class="col-sm-12 canvascontainer">
<div class="demo row">
<div class="row" id="demoSection">
<div class="demo-heading col-sm-6 col-sm-offset-3">
<h2 class="section-heading">Demo</h2>
<hr class="norm-hr"/>
</div>
</div>
<div class="row">
<div class="rules-file-button-container col-sm-2">
<a data-toggle="modal" data-target="#texturesModal" id="textureGuidelines">
<div class="rules-file-button">
<i class="fa fa-th" aria-hidden="true"></i>
</div>
</a>
Texture guidelines
</div>
<div class="file-upload-container col-sm-2">
<input type="file" name="objfile" id="objfile" class="input-file-hidden" accept=".obj"/>
<label for="objfile"><i class="fa fa-upload" aria-hidden="true"></i></label><br>
Upload own .obj file
</div>
<div class="rules-file-button-container col-sm-4">
<a data-toggle="modal" data-target="#editorModal">
<div class="rules-file-button">
<i class="fa fa-th" aria-hidden="true"></i>
</div>
</a>
Rules file options
</div>
<div class="rules-file-button-container col-sm-2">
<a id="shapeGuidelines" data-toggle="modal" data-target="#shapesModal">
<div class="rules-file-button">
<i class="fa fa-codepen" aria-hidden="true"></i>
</div>
</a>
Shape guidelines
</div>
<div class="rules-file-button-container col-sm-2">
<a id="colorGuidelines" data-toggle="modal" data-target="#colorsModal">
<div class="rules-file-button">
<i class="fa fa-paint-brush" aria-hidden="true"></i>
</div>
</a>
Color selector guidelines
</div>
</div>
<div class="canvasSection row">
<!--<div id="sideMenu" class="side-menu col-sm-1">
</div>-->
<div class="col-sm-12">
<div class="rules-file-button-container-dropdown col-sm-2 col-sm-offset-5">
<div class="dropdown">
<button class="btn btn-color-selection" type="button" data-toggle="dropdown">Background Color
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><div class="color-selection" id="darkgrey" style="background-color: #222; color: white;">Grey</div></li>
<li><div class="color-selection" id="lightgrey" style="background-color: #bbb">Lightgrey</div></li>
<li><div class="color-selection" id="lightblue" style="background-color: #A5C7FF">Lightblue</div></li>
<li><div class="color-selection" id="darkdarkgrey" style="background-color: #111; color: white;">Darkgrey</div></li>
<li><div class="color-selection" id="white" style="background-color: #fff">White</div></li>
</ul>
</div>
</div>
</div>
<div class="col-sm-12">
<div id="voxelDemo" width="800" height="400"></div>
</div>
</div>
</div>
<div class="row">
<div class="rules-file-button-container col-sm-12">
<a data-toggle="modal">
<div id="playPauseButton" class="rules-file-button">
<i class="fa fa-play" aria-hidden="true"></i>
</div>
</a>
Pause/Play Animation
</div>
</div>
</div>
<div class="row">
<div id="aboutSection" class="col-sm-12 section">
<img class="geomtest" src="resources/images/geomtest.svg"/>
<div class="col-sm-8 col-sm-offset-2">
<h2 class="section-heading">About</h2>
<hr class="norm-hr"/>
<p class="section-paragraph">
Voxc.js is meant to be a lightweight, easy to use library for converting voxel objects into JavaScript matrixes for easy manipulation. These matrixes can then be used for creating more meshes that have different goals. This library will contain a series of converters that all have a different purpose. The creation and formatting of these converters stay consistent by using JavaScriptmatrixes as input and output.
</p>
<p class="section-paragraph">
The first converter in the demo takes a .obj voxel file that *is uploaded by the user* (still in development) and firstly converts this file to JavaScript matrixes containing the vertices, edges, faces and normals.The first converter then uses these to create and output an array of hex valued colors to be used in follow up converters. The 2nd converter then evaluates the array against a JSON rules file *either uploaded by the user or typed by the user in the text editor on the demo* (still in development). The evaluation will consider the color of the voxel cubes stored in the array and texture them accordingly, the converter will evaluate single colors as well as colors that appear next to each other.
</p>
</div>
</div>
</div>
<div class="row">
<div id="usageSection" class="col-sm-12 section">
<div class="col-sm-8 col-sm-offset-2">
<h2 class="section-heading">Usage</h2>
<hr class="norm-hr"/>
<p class="section-paragraph">
voxc.js is used by downloading the minified javascript file and including it in your project.
</p>
<p class="section-paragraph">
voxc.min.js contains a class called VoxJSCanvas, and by constructing the class with the id of any div such as, new VoxJSCanvas("VoxelDemo"), the class will create a THREE.js canvas/scene with the required basics to display all our meshes.
</p>
<div class="console-command col-sm-12">
<div id="voxelDemo"></div>
</div>
<div class="row">
<div class="console-command col-sm-12">
<h4 class="console-command-heading">Download Minified Javascript:</h4>
<a href="build/js/voxc.min.js" download>voxc.min.js</a>
</div>
</div>
<h5>Creation of canvas and setting up wireframe-mesh display</h5>
<pre><code class="language-javascript"> var converterOne_canvas = new voxJSCanvas("voxelDemo");
var converterOne_model;
var arrayToMesh = new ArrayToMesh(converterOne_canvas.scene, model);
converterOne_model = arrayToMesh.output();
converterOne_canvas.CameraPosition(0, 0, -10);
converterOne_canvas.setMesh(converterOne_model);
converterOne_canvas.start();
</code></pre>
</div>
</div>
</div>
<div class="footer row index-footer">
<div class="col-sm-1 col-sm-offset-1">
<a href="https://github.com/Idrian/Absolute-0-" target="_blank"><span class="footer-icon fa fa-github-square fa-5x"></span></a>
</div>
<div class="col-sm-8">
<div class="footer-links row">
<a class="navlink-footer" href="#documentsSection">Documentation</a>
·
<a class="navlink-footer" href="#demoSection">Demo</a>
·
<a class="navlink-footer" href="#aboutSection">About</a>
·
<a class="navlink-footer" href="#usageSection">Usage</a>
·
<a class="navlink-footer" href="converter1.html">.obj to Array</a>
·
<a class="navlink-footer" href="converter2.html">Rule Applyer</a>
·
<a class="navlink-footer" href="mriscan.html">Image to Array</a>
·
</div>
<div class="footer-brand row">
<div class="col-sm-12">
voxc.js
</div>
</div>
<div class="footer-author row">
Team Absolute|0| @ 2017
</div>
</div>
<div class="col-sm-2">
<a href="https://waffle.io/Idrian/Absolute-0-?utm_source=badge" target="_blank"><img class="waffle-icon" height="100px" width="100px" src="resources/images/waffle.png"/></a>
</div>
</div>
</div>
<div id="editorModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Edit the rules file</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="file-upload-container col-sm-4 col-sm-offset-2">
<input type="file" name="file" id="file" class="input-file-hidden" accept=".obj"/>
<label for="file"><i class="fa fa-upload" aria-hidden="true"></i></label><br>
Upload own rules file
</div>
<div id="predefinedRules" class="rules-file-button-container col-sm-4">
<div class="rules-file-button">
<i class="fa fa-download" aria-hidden="true"></i>
</div>
Use predefined rules file
</div>
</div>
<div id="editor">{"Rules" :
[{
"Key" : "0x664611" ,
"Shape" : "Cylinder",
"Texture" : "./resources/textures/oak.png",
"Bmap" : "./resources/textures/oakBump.png"
},{
"Key" : "0x00ff00",
"Shape" : "Sphere",
"scale" : [1.5,1.5,1.5],
"Texture" : "./resources/textures/texture_leaves_by_kuschelirmel_stock.jpg",
"Bmap" : "./resources/textures/texture_leaves_by_kuschelirmel_stockBump.jpg"
},{
"Key" : "0x00ff01",
"Shape" : "Cube",
"Texture" : "./resources/textures/texture_leaves_by_kuschelirmel_stock.jpg",
"Bmap" : "./resources/textures/texture_leaves_by_kuschelirmel_stockBump.jpg"
}]
}<br></div><button class="rules-file-upload-button" data-dismiss="modal">Save and upload</button>
</div>
</div>
</div>
</div>
<div id="shapesModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Rules file shape guidelines</h4>
</div>
<div class="modal-body">
The value located at "-----------" can be changed to any of the shapes specified below.
<pre><code class="language-javascript">{"Rules" :
[{
"Color" : "0x664611",
"Shape" : "-----------",
"Texture" : "./resources/textures/-----.jpg"
]}
}
</code></pre><br/>
<div class="col-sm-6"><h4>Available shapes:</h4></div><div class="col-sm-6"><input class="modal-search" id="shapeSearchText" type="text" placeholder="Search for shapes here..."/></div>
<div class="available-shapes-list" id="availableShapesList">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div id="texturesModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Rules file texture guidelines</h4>
</div>
<div class="modal-body">
The value located at "./resources/textures/-----.jpg" can be changed to any of the textures listed below
<pre><code class="language-javascript">{"Rules" :
[{
"Color" : "0x664611",
"Shape" : "Cylinder",
"Texture" : "./resources/textures/-----.jpg"
]}
}
</code></pre><br/>
<div class="col-sm-6"><h4>Available textures:</h4></div><div class="col-sm-6"><input class="modal-search" id="textureSearchText" type="text" placeholder="Search for textures here..."/></div>
<div class="texture-list">
<div class="row align-items-center" id="availableTexturesList">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
<div id="colorsModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Rules file color guidelines</h4>
</div>
<div class="modal-body">
The value located at "----------" can be changed to any of the colors listed below
<pre><code class="language-javascript">{"Rules" :
[{
"Color" : "----------",
"Shape" : "Cylinder",
"Texture" : "./resources/textures/-----.jpg"
]}
</code></pre><br/>
<div id="colorGuidelinesCanvas" width="800" height="400"></div>
<h4>Available colors:</h4>
<div id="availableColorList" class="row available-color-list">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
<script src="js/guidelines.js"></script>
<script>
//Smooth Scroll
$(document).ready(function(){
$('a[href^="#"]').on('click',function (e) {
e.preventDefault();
var target = this.hash,
$target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top-50
}, 700, 'swing', function () {
window.location.hash = target;
});
});
});
//Change navbar active class on click
$(".nav li").on("click", function() {
$(".nav li").removeClass("active");
$(this).addClass("active");
});
//Reset active class on brand click
$(".navbar-brand").on("click", function(){
$(".nav li").removeClass("active");
})
</script>
<script>
var isBlurred = false;
var editor = ace.edit("editor");
editor.setTheme("ace/theme/solarized_dark");
var JSONMode = ace.require("ace/mode/json").Mode;
editor.session.setMode(new JSONMode());
document.getElementById("predefinedRules").onclick = function(){
editor.setValue(`{"Rules" :
[{
"Key" : "0x664611" ,
"Shape" : "Cylinder",
"Texture" : "./resources/textures/oak.png",
"Bmap" : "./resources/textures/oakBump.png"
},{
"Key" : "0x00ff00",
"Shape" : "Sphere",
"scale" : [1.5,1.5,1.5],
"Texture" : "./resources/textures/texture_leaves_by_kuschelirmel_stock.jpg",
"Bmap" : "./resources/textures/texture_leaves_by_kuschelirmel_stockBump.jpg"
},{
"Key" : "0x00ff01",
"Shape" : "Cube",
"Texture" : "./resources/textures/texture_leaves_by_kuschelirmel_stock.jpg",
"Bmap" : "./resources/textures/texture_leaves_by_kuschelirmel_stockBump.jpg"
}]
}`, 1);
}
/*var sideMenu = document.getElementById("sideMenu");
sideMenu.onclick = function(){
if (isBlurred == true){
isBlurred = false;
document.body.className = "";
} else {
document.getElementById("container").classList.add("blur");
sideMenu.style.webkitFilter = none;
isBlurred = true;
}
}*/
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.0/prism.min.js"></script>
</body>
</html>