Skip to content

Commit

Permalink
#9 #7 #10 #19 Just everything
Browse files Browse the repository at this point in the history
  • Loading branch information
Idrian committed Aug 23, 2017
1 parent 53b397d commit 9ed0e7a
Show file tree
Hide file tree
Showing 24 changed files with 373 additions and 62 deletions.
2 changes: 1 addition & 1 deletion build/ArrayToMesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class ArrayToMesh
let singleCube = new THREE.Mesh( geometry, material );

singleCube.position.set(-x+xLength,y-yLength,z-zLength);

singleCube.name = x.toString()+y.toString()+z.toString();
this.theMesh.add(singleCube);
}

Expand Down
6 changes: 5 additions & 1 deletion build/ObjToArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ export class fileReader {
me.setVertex(lines[line], false);
}
}

console.log("Vertexes" , me.GvArray);
console.log("Normals" , me.GvnArray);
console.log("Faces" , me.GfArray);
//console.log("Cameron is wrong test 1",this.element.name);
me.buildMatrix();
me.buildMatrix();
me.fillColors(callback,other);
me.ready = true;

Expand Down
38 changes: 25 additions & 13 deletions build/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,14 @@ let arrayToMesh = new ArrayToMesh(model);
converterTwo_canvasTwo.setBackgroundColor(0xffffff);
converterTwo_canvasTwo.start();

var editor = <HTMLDivElement>document.getElementById("editor");

var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""),editor.textContent.indexOf("}X")+1);
console.log("editor",jsonString)
var editor = ace.edit("editor");
//editor.container = <HTMLDivElement>document.getElementById("editor");

// var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""),editor.textContent.indexOf("}X")+1);
console.log("Full editor",editor.getValue());
var jsonString = editor.getValue();
console.log("editor",jsonString)
// console.log("editor",jsonString);

var ruleFile = JSON.parse(jsonString);
Expand All @@ -283,7 +287,7 @@ let arrayToMesh = new ArrayToMesh(model);
demo_canvas.setMesh(converterOne_model);
demo_canvas.start();

var uplouder = document.getElementsByClassName("rules-file-button");
var uplouder = document.getElementsByClassName("rules-file-upload-button");

var objUpload = <HTMLInputElement>document.getElementById("file");

Expand All @@ -304,8 +308,11 @@ let arrayToMesh = new ArrayToMesh(model);
{
uplouder[0].addEventListener("click", function()
{
var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""),editor.textContent.indexOf("}X")+1);
console.log("editor",jsonString)
// var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""),editor.textContent.indexOf("}X")+1);

console.log("Full editor",editor.getValue());
var jsonString = editor.getValue();
console.log("editor",jsonString)
//console.log("Input File array 5",array);
ruleFile = JSON.parse(jsonString);
ruleApplyer.convert(ruleFile, model);
Expand All @@ -332,12 +339,15 @@ function doRest(model : string[][][],other : any)
var arrayToMesh = new ArrayToMesh(model);
other[1].setMesh(arrayToMesh.output());


var editor = <HTMLDivElement>document.getElementById("editor");
var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""),editor.textContent.indexOf("}X")+1);
var editor = ace.edit("editor");
// var editor = <HTMLDivElement>document.getElementById("editor");
// var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""),editor.textContent.indexOf("}X")+1);
// console.log("editor",jsonString)
//console.log("Input File array 5",array);
var ruleFile = JSON.parse(jsonString);

console.log("Full editor",editor.getValue());
var jsonString = editor.getValue();
var ruleFile = JSON.parse(jsonString);
other[2].convert(ruleFile, model);
var converterOne_model = new THREE.Group();
// console.log("Before Group",converterOne_model);
Expand All @@ -348,11 +358,13 @@ function doRest(model : string[][][],other : any)
other[0].setMesh(converterOne_model);


var uplouder = document.getElementsByClassName("rules-file-button");
var uplouder = document.getElementsByClassName("rules-file-upload-button");
uplouder[0].addEventListener("click", function()
{
var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""),editor.textContent.indexOf("}X")+1);
console.log("editor",jsonString)
// var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""),editor.textContent.indexOf("}X")+1);

var jsonString = editor.getValue();
console.log("editor",jsonString)
//console.log("Input File array 5",array);
ruleFile = JSON.parse(jsonString);
other[2].convert(ruleFile, model);
Expand Down
31 changes: 21 additions & 10 deletions build/voxc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ArrayToMesh {
else {
let singleCube = new THREE.Mesh(geometry, material);
singleCube.position.set(-x + xLength, y - yLength, z - zLength);
singleCube.name = x.toString() + y.toString() + z.toString();
this.theMesh.add(singleCube);
}
// scene.add(singleCube);
Expand Down Expand Up @@ -149,6 +150,9 @@ class fileReader {
me.setVertex(lines[line], false);
}
}
console.log("Vertexes", me.GvArray);
console.log("Normals", me.GvnArray);
console.log("Faces", me.GfArray);
//console.log("Cameron is wrong test 1",this.element.name);
me.buildMatrix();
me.fillColors(callback, other);
Expand Down Expand Up @@ -181,8 +185,6 @@ class fileReader {
};
this.reader.readAsText(file);
}
loadOBJ() {
}
getArray() {
return this.finalMatrix;
}
Expand Down Expand Up @@ -1929,8 +1931,11 @@ window.onload = () => {
converterTwo_canvasTwo.setMesh(arrayToMesh.output());
converterTwo_canvasTwo.setBackgroundColor(0xffffff);
converterTwo_canvasTwo.start();
var editor = document.getElementById("editor");
var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""), editor.textContent.indexOf("}X") + 1);
var editor = ace.edit("editor");
//editor.container = <HTMLDivElement>document.getElementById("editor");
// var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""),editor.textContent.indexOf("}X")+1);
console.log("Full editor", editor.getValue());
var jsonString = editor.getValue();
console.log("editor", jsonString);
// console.log("editor",jsonString);
var ruleFile = JSON.parse(jsonString);
Expand All @@ -1944,7 +1949,7 @@ window.onload = () => {
demo_canvas.setGridHelper(model.length, model[0].length, model[0][0].length);
demo_canvas.setMesh(converterOne_model);
demo_canvas.start();
var uplouder = document.getElementsByClassName("rules-file-button");
var uplouder = document.getElementsByClassName("rules-file-upload-button");
var objUpload = document.getElementById("file");
var converterOne;
var useME = true;
Expand All @@ -1956,7 +1961,9 @@ window.onload = () => {
});
if (useME == true) {
uplouder[0].addEventListener("click", function () {
var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""), editor.textContent.indexOf("}X") + 1);
// var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""),editor.textContent.indexOf("}X")+1);
console.log("Full editor", editor.getValue());
var jsonString = editor.getValue();
console.log("editor", jsonString);
//console.log("Input File array 5",array);
ruleFile = JSON.parse(jsonString);
Expand All @@ -1976,20 +1983,24 @@ function doRest(model, other) {
other[1].CameraPosition(0, 0, 10);
var arrayToMesh = new ArrayToMesh_1.ArrayToMesh(model);
other[1].setMesh(arrayToMesh.output());
var editor = document.getElementById("editor");
var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""), editor.textContent.indexOf("}X") + 1);
var editor = ace.edit("editor");
// var editor = <HTMLDivElement>document.getElementById("editor");
// var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""),editor.textContent.indexOf("}X")+1);
// console.log("editor",jsonString)
//console.log("Input File array 5",array);
console.log("Full editor", editor.getValue());
var jsonString = editor.getValue();
var ruleFile = JSON.parse(jsonString);
other[2].convert(ruleFile, model);
var converterOne_model = new THREE.Group();
// console.log("Before Group",converterOne_model);
// console.log("After Group",converterOne_model);
other[0].setGridHelper(model.length, model[0].length, model[0][0].length);
other[0].setMesh(converterOne_model);
var uplouder = document.getElementsByClassName("rules-file-button");
var uplouder = document.getElementsByClassName("rules-file-upload-button");
uplouder[0].addEventListener("click", function () {
var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""), editor.textContent.indexOf("}X") + 1);
// var jsonString = editor.textContent.slice(editor.textContent.indexOf("{\"Rules\""),editor.textContent.indexOf("}X")+1);
var jsonString = editor.getValue();
console.log("editor", jsonString);
//console.log("Input File array 5",array);
ruleFile = JSON.parse(jsonString);
Expand Down
75 changes: 73 additions & 2 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ a{
#editor {
width: 100%;
height: 400px;
margin-bottom: 100px;
}

.navbar{
Expand Down Expand Up @@ -382,7 +381,6 @@ a{

#editor{
margin-top: 30px;
margin-bottom: 30px;
}

#converter1Canvas{
Expand Down Expand Up @@ -425,3 +423,76 @@ input[type=range][orient=vertical]
margin-top: 40px;
}

.rules-file-upload-button{
border: none;
outline: none;
width: 100%;
background-color: #86DCEF;
color: #222;
height: 30px;
margin-bottom: 40px;
}

.rules-file-upload-button:hover{
background-color: #29badb;
}

.texture-list{
margin-top: 40px;
height: 250px;
overflow-y: scroll;
overflow-x: hidden;
}

.texture-example-container{
height: 60px;
margin-bottom: 40px;
}

.texture-example-image-container{
text-align: center;
}

.texture-example-image{
width: 60%;
}

.texture-example-name{
margin-top: 15px;
font-size: 15px;
}

.texture-example-value-{
color: #a6e22e;
}

.available-shapes-list{
height: 250px;
overflow-y: scroll;
}

.available-shapes-list{
margin-top: 40px;
height: 250px;
overflow-y: scroll;
overflow-x: hidden;
}

.shape-example-container{
height: 60px;
margin-bottom: 40px;
}

.shape-example-image-container{
text-align: center;
}

.shape-example-image{
width: 60%;
}

.shape-example-name{
margin-top: 15px;
font-size: 15px;
}

Loading

0 comments on commit 9ed0e7a

Please sign in to comment.