Skip to content

Commit

Permalink
change "transparency" to "opacity"
Browse files Browse the repository at this point in the history
  • Loading branch information
biasmv committed Sep 9, 2014
1 parent 30fd8f1 commit 7be26ac
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ <h1></h1>
slide: function(event, ui) {

pv.forEach(function(go) {
go.setTransparency(1.0 - ui.value/100. , go);
go.setOpacity(1.0 - ui.value/100. , go);
});
pv.requestRedraw();
}
Expand Down
18 changes: 9 additions & 9 deletions src/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,12 @@ LineGeom.prototype.colorBy = function(colorFunc, view) {
console.timeEnd('LineGeom.colorBy');
};

LineGeom.prototype.setTransparency = function(val, view) {
console.time('LineGeom.setTransparency');
LineGeom.prototype.setOpacity = function(val, view) {
console.time('LineGeom.setOpacity');
this._ready = false;
view = view || this.structure();
this._vertAssoc.setTransparency(val, view);
console.timeEnd('LineGeom.setTransparency');
this._vertAssoc.setOpacity(val, view);
console.timeEnd('LineGeom.setOpacity');
};


Expand All @@ -369,7 +369,7 @@ LineGeom.prototype.setTransparency = function(val, view) {
//
// the vertex data is stored in the following format;
//
// Px Py Pz Nx Ny Nz Cr Cg Cb Id
// Px Py Pz Nx Ny Nz Cr Cg Cb Ca Id
//
// , where P is the position, N the normal and C the color information
// of the vertex.
Expand Down Expand Up @@ -485,12 +485,12 @@ MeshGeom.prototype.colorBy = function(colorFunc, view) {
console.timeEnd('MeshGeom.colorBy');
};

MeshGeom.prototype.setTransparency = function(val, view) {
console.time('MeshGeom.setTransparency');
MeshGeom.prototype.setOpacity = function(val, view) {
console.time('MeshGeom.setOpacity');
this._ready = false;
view = view || this.structure();
this._vertAssoc.setTransparency(val , view);
console.timeEnd('MeshGeom.setTransparency');
this._vertAssoc.setOpacity(val , view);
console.timeEnd('MeshGeom.setOpacity');
};

MeshGeom.prototype._drawVertArrays = function(cam, shader, indexedVertArrays,
Expand Down
8 changes: 4 additions & 4 deletions src/vert-assoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ AtomVertexAssoc.prototype.recolor = function(colorOp, view) {
}
};

AtomVertexAssoc.prototype.setTransparency = function( val, view) {
AtomVertexAssoc.prototype.setOpacity = function( val, view) {
// apply the color to the actual interleaved vertex array.
for (var i = 0; i < this._assocs.length; ++i) {
var assoc = this._assocs[i];
var va = assoc.vertexArray;
for (var j = assoc.vertStart ; j < assoc.vertEnd; ++j) {
va.setTransparency(j, val);
va.setOpacity(j, val);
}
}
};
Expand Down Expand Up @@ -159,13 +159,13 @@ TraceVertexAssoc.prototype.recolor = function(colorOp, view) {
};


TraceVertexAssoc.prototype.setTransparency = function( val, view) {
TraceVertexAssoc.prototype.setOpacity = function( val, view) {
// store the color in the actual interleaved vertex array.
for (i = 0; i < this._assocs.length; ++i) {
var assoc = this._assocs[i];
var va = assoc.vertexArray;
for (j = assoc.vertStart ; j < assoc.vertEnd; ++j) {
va.setTransparency(j, val);
va.setOpacity(j, val);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/vertex-array-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ VertexArrayBase.prototype.setColor = function(index, r, g, b, a) {
this._ready = false;
};

VertexArrayBase.prototype.setTransparency = function(index, a) {
VertexArrayBase.prototype.setOpacity = function(index, a) {
var colorStart = index * this._FLOATS_PER_VERT + this._COLOR_OFFSET;
this._vertData[colorStart + 3] = a;
this._ready = false;
Expand Down

0 comments on commit 7be26ac

Please sign in to comment.