aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom/geom-obj.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/geom/geom-obj.js')
-rwxr-xr-xjs/lib/geom/geom-obj.js40
1 files changed, 20 insertions, 20 deletions
diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js
index 5373c78a..d859d025 100755
--- a/js/lib/geom/geom-obj.js
+++ b/js/lib/geom/geom-obj.js
@@ -288,13 +288,13 @@ exports.GeomObj = Object.create(Object.prototype, {
288 this._materialArray.push(strokeMaterial); 288 this._materialArray.push(strokeMaterial);
289 this._materialTypeArray.push("stroke"); 289 this._materialTypeArray.push("stroke");
290 290
291 // don't set the value here. The material editor may set a color directly 291 // don't set the value here. The material editor may set a color directly
292 // to the material without setting this value in the obj. The following 292 // to the material without setting this value in the obj. The following
293 // lines of code will clobber the value in the material 293 // lines of code will clobber the value in the material
294 //if (this._strokeColor) 294 //if (this._strokeColor)
295 // this.setStrokeColor(this._strokeColor); 295 // this.setStrokeColor(this._strokeColor);
296 296
297 this._strokeMaterial = strokeMaterial; 297 this._strokeMaterial = strokeMaterial;
298 298
299 return strokeMaterial; 299 return strokeMaterial;
300 } 300 }
@@ -315,14 +315,14 @@ exports.GeomObj = Object.create(Object.prototype, {
315 315
316 this._materialArray.push(fillMaterial); 316 this._materialArray.push(fillMaterial);
317 this._materialTypeArray.push("fill"); 317 this._materialTypeArray.push("fill");
318 318
319 // don't set the value here. The material editor may set a color directly 319 // don't set the value here. The material editor may set a color directly
320 // to the material without setting this value in the obj. The following 320 // to the material without setting this value in the obj. The following
321 // lines of code will clobber the value in the material 321 // lines of code will clobber the value in the material
322 //if (this._fillColor) 322 //if (this._fillColor)
323 // this.setFillColor(this._fillColor); 323 // this.setFillColor(this._fillColor);
324 324
325 this._fillMaterial = fillMaterial; 325 this._fillMaterial = fillMaterial;
326 326
327 return fillMaterial; 327 return fillMaterial;
328 } 328 }
@@ -330,7 +330,7 @@ exports.GeomObj = Object.create(Object.prototype, {
330 330
331 exportMaterialsJSON: { 331 exportMaterialsJSON: {
332 value: function() { 332 value: function() {
333 MaterialsModel = require("js/models/materials-model").MaterialsModel; 333 MaterialsModel = require("js/models/materials-model").MaterialsModel;
334 334
335 var jObj; 335 var jObj;
336 if (this._materialArray && this._materialNodeArray && this.getWorld().isWebGL()) { 336 if (this._materialArray && this._materialNodeArray && this.getWorld().isWebGL()) {
@@ -362,7 +362,7 @@ exports.GeomObj = Object.create(Object.prototype, {
362 362
363 importMaterialsJSON: { 363 importMaterialsJSON: {
364 value: function(jObj) { 364 value: function(jObj) {
365 MaterialsModel = require("js/models/materials-model").MaterialsModel; 365 MaterialsModel = require("js/models/materials-model").MaterialsModel;
366 366
367 this._materialArray = []; 367 this._materialArray = [];
368 this._materialTypeArray = []; 368 this._materialTypeArray = [];
@@ -389,7 +389,7 @@ exports.GeomObj = Object.create(Object.prototype, {
389 case "tunnel": 389 case "tunnel":
390 case "reliefTunnel": 390 case "reliefTunnel":
391 case "squareTunnel": 391 case "squareTunnel":
392 case "flag": 392 case "flag":
393 case "twist": 393 case "twist":
394 case "fly": 394 case "fly":
395 case "julia": 395 case "julia":
@@ -399,8 +399,8 @@ exports.GeomObj = Object.create(Object.prototype, {
399 case "keleidoscope": 399 case "keleidoscope":
400 case "radialBlur": 400 case "radialBlur":
401 case "pulse": 401 case "pulse":
402 case "twistVert": 402 case "twistVert":
403 case "taper": 403 case "taper":
404 mat = MaterialsModel.getMaterialByShader(shaderName); 404 mat = MaterialsModel.getMaterialByShader(shaderName);
405 if (mat) mat = mat.dup(); 405 if (mat) mat = mat.dup();
406 break; 406 break;
@@ -454,12 +454,12 @@ exports.GeomObj = Object.create(Object.prototype, {
454 // get the normalized device coordinates (NDC) for 454 // get the normalized device coordinates (NDC) for
455 // all position and dimensions. 455 // all position and dimensions.
456 var world = this.getWorld(); 456 var world = this.getWorld();
457 var vpw = world.getViewportWidth(), vph = world.getViewportHeight(); 457 var vpw = world.getViewportWidth(), vph = world.getViewportHeight();
458 var xNDC = 2*this._xOffset/vpw, yNDC = -2*this._yOffset/vph; 458 var xNDC = 2*this._xOffset/vpw, yNDC = -2*this._yOffset/vph;
459 459
460 var aspect = world.getAspect(); 460 var aspect = world.getAspect();
461 var zn = world.getZNear(), zf = world.getZFar(); 461 var zn = world.getZNear(), zf = world.getZFar();
462 var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0), 462 var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0),
463 b = -t, 463 b = -t,
464 r = aspect*t, 464 r = aspect*t,
465 l = -r; 465 l = -r;
@@ -484,12 +484,12 @@ exports.GeomObj = Object.create(Object.prototype, {
484 // get the normalized device coordinates (NDC) for 484 // get the normalized device coordinates (NDC) for
485 // all position and dimensions. 485 // all position and dimensions.
486 var world = this.getWorld(); 486 var world = this.getWorld();
487 var vpw = world.getViewportWidth(), vph = world.getViewportHeight(); 487 var vpw = world.getViewportWidth(), vph = world.getViewportHeight();
488 var xNDC = 2*preViewPt[0]/vpw, yNDC = -2*preViewPt[1]/vph; 488 var xNDC = 2*preViewPt[0]/vpw, yNDC = -2*preViewPt[1]/vph;
489 489
490 var aspect = world.getAspect(); 490 var aspect = world.getAspect();
491 var zn = world.getZNear(), zf = world.getZFar(); 491 var zn = world.getZNear(), zf = world.getZFar();
492 var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0), 492 var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0),
493 b = -t, 493 b = -t,
494 r = aspect*t, 494 r = aspect*t,
495 l = -r; 495 l = -r;