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 4b8e1c69..c0c7504f 100755
--- a/js/lib/geom/geom-obj.js
+++ b/js/lib/geom/geom-obj.js
@@ -305,13 +305,13 @@ exports.GeomObj = Object.create(Object.prototype, {
305 this._materialArray.push(strokeMaterial); 305 this._materialArray.push(strokeMaterial);
306 this._materialTypeArray.push("stroke"); 306 this._materialTypeArray.push("stroke");
307 307
308 // don't set the value here. The material editor may set a color directly 308 // don't set the value here. The material editor may set a color directly
309 // to the material without setting this value in the obj. The following 309 // to the material without setting this value in the obj. The following
310 // lines of code will clobber the value in the material 310 // lines of code will clobber the value in the material
311 //if (this._strokeColor) 311 //if (this._strokeColor)
312 // this.setStrokeColor(this._strokeColor); 312 // this.setStrokeColor(this._strokeColor);
313 313
314 this._strokeMaterial = strokeMaterial; 314 this._strokeMaterial = strokeMaterial;
315 315
316 return strokeMaterial; 316 return strokeMaterial;
317 } 317 }
@@ -332,14 +332,14 @@ exports.GeomObj = Object.create(Object.prototype, {
332 332
333 this._materialArray.push(fillMaterial); 333 this._materialArray.push(fillMaterial);
334 this._materialTypeArray.push("fill"); 334 this._materialTypeArray.push("fill");
335 335
336 // don't set the value here. The material editor may set a color directly 336 // don't set the value here. The material editor may set a color directly
337 // to the material without setting this value in the obj. The following 337 // to the material without setting this value in the obj. The following
338 // lines of code will clobber the value in the material 338 // lines of code will clobber the value in the material
339 //if (this._fillColor) 339 //if (this._fillColor)
340 // this.setFillColor(this._fillColor); 340 // this.setFillColor(this._fillColor);
341 341
342 this._fillMaterial = fillMaterial; 342 this._fillMaterial = fillMaterial;
343 343
344 return fillMaterial; 344 return fillMaterial;
345 } 345 }
@@ -347,7 +347,7 @@ exports.GeomObj = Object.create(Object.prototype, {
347 347
348 exportMaterialsJSON: { 348 exportMaterialsJSON: {
349 value: function() { 349 value: function() {
350 MaterialsModel = require("js/models/materials-model").MaterialsModel; 350 MaterialsModel = require("js/models/materials-model").MaterialsModel;
351 351
352 var jObj; 352 var jObj;
353 if (this._materialArray && this._materialNodeArray && this.getWorld().isWebGL()) { 353 if (this._materialArray && this._materialNodeArray && this.getWorld().isWebGL()) {
@@ -379,7 +379,7 @@ exports.GeomObj = Object.create(Object.prototype, {
379 379
380 importMaterialsJSON: { 380 importMaterialsJSON: {
381 value: function(jObj) { 381 value: function(jObj) {
382 MaterialsModel = require("js/models/materials-model").MaterialsModel; 382 MaterialsModel = require("js/models/materials-model").MaterialsModel;
383 383
384 this._materialArray = []; 384 this._materialArray = [];
385 this._materialTypeArray = []; 385 this._materialTypeArray = [];
@@ -406,7 +406,7 @@ exports.GeomObj = Object.create(Object.prototype, {
406 case "tunnel": 406 case "tunnel":
407 case "reliefTunnel": 407 case "reliefTunnel":
408 case "squareTunnel": 408 case "squareTunnel":
409 case "flag": 409 case "flag":
410 case "twist": 410 case "twist":
411 case "fly": 411 case "fly":
412 case "julia": 412 case "julia":
@@ -416,8 +416,8 @@ exports.GeomObj = Object.create(Object.prototype, {
416 case "keleidoscope": 416 case "keleidoscope":
417 case "radialBlur": 417 case "radialBlur":
418 case "pulse": 418 case "pulse":
419 case "twistVert": 419 case "twistVert":
420 case "taper": 420 case "taper":
421 mat = MaterialsModel.getMaterialByShader(shaderName); 421 mat = MaterialsModel.getMaterialByShader(shaderName);
422 if (mat) mat = mat.dup(); 422 if (mat) mat = mat.dup();
423 break; 423 break;
@@ -471,12 +471,12 @@ exports.GeomObj = Object.create(Object.prototype, {
471 // get the normalized device coordinates (NDC) for 471 // get the normalized device coordinates (NDC) for
472 // all position and dimensions. 472 // all position and dimensions.
473 var world = this.getWorld(); 473 var world = this.getWorld();
474 var vpw = world.getViewportWidth(), vph = world.getViewportHeight(); 474 var vpw = world.getViewportWidth(), vph = world.getViewportHeight();
475 var xNDC = 2*this._xOffset/vpw, yNDC = -2*this._yOffset/vph; 475 var xNDC = 2*this._xOffset/vpw, yNDC = -2*this._yOffset/vph;
476 476
477 var aspect = world.getAspect(); 477 var aspect = world.getAspect();
478 var zn = world.getZNear(), zf = world.getZFar(); 478 var zn = world.getZNear(), zf = world.getZFar();
479 var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0), 479 var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0),
480 b = -t, 480 b = -t,
481 r = aspect*t, 481 r = aspect*t,
482 l = -r; 482 l = -r;
@@ -501,12 +501,12 @@ exports.GeomObj = Object.create(Object.prototype, {
501 // get the normalized device coordinates (NDC) for 501 // get the normalized device coordinates (NDC) for
502 // all position and dimensions. 502 // all position and dimensions.
503 var world = this.getWorld(); 503 var world = this.getWorld();
504 var vpw = world.getViewportWidth(), vph = world.getViewportHeight(); 504 var vpw = world.getViewportWidth(), vph = world.getViewportHeight();
505 var xNDC = 2*preViewPt[0]/vpw, yNDC = -2*preViewPt[1]/vph; 505 var xNDC = 2*preViewPt[0]/vpw, yNDC = -2*preViewPt[1]/vph;
506 506
507 var aspect = world.getAspect(); 507 var aspect = world.getAspect();
508 var zn = world.getZNear(), zf = world.getZFar(); 508 var zn = world.getZNear(), zf = world.getZFar();
509 var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0), 509 var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0),
510 b = -t, 510 b = -t,
511 r = aspect*t, 511 r = aspect*t,
512 l = -r; 512 l = -r;