3dmol
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -99,3 +99,3 @@ //color scheme mappings | ||
//scale bottom from red to white | ||
if (val <= middle) { | ||
if (val < middle) { | ||
scale = Math.floor(255 * Math.sqrt((val - lo) / (middle - lo))); | ||
@@ -105,6 +105,8 @@ color = 0xff0000 + 0x100 * scale + scale; | ||
} | ||
else { //form white to blue | ||
else if(val > middle){ //form white to blue | ||
scale = Math.floor(255 * Math.sqrt((1 - (val - middle) / (hi - middle)))); | ||
color = 0x10000 * scale + 0x100 * scale + 0xff; | ||
return color; | ||
} else { //val == middle | ||
return 0xffffff; | ||
} | ||
@@ -111,0 +113,0 @@ }; |
@@ -164,3 +164,3 @@ /** | ||
this.isLost = function() { | ||
return _gl.isContextLost; | ||
return _gl.isContextLost(); | ||
}; | ||
@@ -804,8 +804,3 @@ | ||
m_uniforms.outlinePushback.value = material.outlinePushback; | ||
} else if (material.shaderID === "sphereimposter") { | ||
_gl.uniformMatrix4fv(p_uniforms.viewMatrix, false, | ||
camera.matrixWorldInverse.elements); | ||
m_uniforms.directionalLightColor.value = _lights.directional.colors; | ||
m_uniforms.directionalLightDirection.value = _lights.directional.positions; | ||
} else if (material.shaderID === "volumetric") { | ||
} else if (material.shaderID === "volumetric") { | ||
@@ -812,0 +807,0 @@ //need a matrix that maps back from model coordinates to texture coordinates |
@@ -53,3 +53,4 @@ | ||
" vec3 p = pos;", //ray point | ||
" vec3 v = normalize(pos);", //ray normal | ||
" vec3 v = vec3(0.0,0.0,-1.0);", //ray normal - orthographic | ||
" if(projectionMatrix[3][3] == 0.0) v = normalize(pos);", //ray normal - perspective | ||
" vec3 pa = p1;", //cyl start | ||
@@ -77,3 +78,3 @@ " vec3 va = normalize(p2-p1);", //cyl norm | ||
" vec3 cp;", | ||
" if( dotp1 < 0.0) {" + | ||
" if( dotp1 < 0.0) { " + | ||
//" if(vColor.x < 0.0 ) discard;", //color sign bit indicates if we should cap or not | ||
@@ -95,4 +96,4 @@ " cp = p1;", | ||
" float t = min(posT,negT);", | ||
" qi = p+v*t;", | ||
" norm = normalize(qi-cp);", | ||
" qi = p+v*t; ", | ||
" norm = normalize(qi-cp); ", | ||
" } else {", | ||
@@ -603,9 +604,17 @@ " norm = normalize(qi-(dotp1*va + p1));", | ||
" if(color.z >= 0.0) {", //p1 | ||
" vec3 pnorm = normalize(p1);", | ||
" float t = dot(mvPosition.xyz-p1,n)/dot(pnorm,n);", | ||
" mvPosition.xyz = p1+t*pnorm;", | ||
" if(projectionMatrix[3][3] == 0.0) {", //perspective | ||
" vec3 pnorm = normalize(p1);", | ||
" float t = dot(mvPosition.xyz-p1,n)/dot(pnorm,n);", | ||
" mvPosition.xyz = p1+t*pnorm;", | ||
" } else {", //orthographic | ||
" mvPosition.xyz = p1;", | ||
" }", | ||
" } else {", | ||
" vec3 pnorm = normalize(p2);", | ||
" float t = dot(mvPosition.xyz-p2,n)/dot(pnorm,n);", | ||
" mvPosition.xyz = p2+t*pnorm;", | ||
" if(projectionMatrix[3][3] == 0.0) {", //perspective | ||
" vec3 pnorm = normalize(p2);", | ||
" float t = dot(mvPosition.xyz-p2,n)/dot(pnorm,n);", | ||
" mvPosition.xyz = p2+t*pnorm;", | ||
" } else {", //orthographic | ||
" mvPosition.xyz = p2;", | ||
" }", | ||
" mult *= -1.0;", | ||
@@ -612,0 +621,0 @@ " }", |
{ | ||
"name": "3dmol", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "Object oriented Javascript molecular visualization library", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -15,2 +15,3 @@ <script src="../build/3Dmol-min.js"></script> | ||
- **data-pdb** The value describes a PDB ID to be loaded into the viewer. | ||
- **data-cid** The value describes a PubChem compound id to be loaded into the viewer. | ||
- **data-href** The value is a URL to a molecular data file. | ||
@@ -17,0 +18,0 @@ - **data-element** The value is the id of an HTML element on the current page that has molecular data embedded in it. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
80751645
268
298706