zincjs 2.2.1 → 2.3.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/zinc.js +268 -71
- package/build/zinc.js.map +1 -1
- package/package.json +7 -3
- package/src/loaders/niftiReader.js +1 -1
- package/src/minimap.js +2 -2
- package/src/primitives/augmentShader.js +39 -22
- package/src/primitives/geometry.js +24 -29
- package/src/primitives/glyphset.js +2 -2
- package/src/primitives/label.js +6 -1
- package/src/primitives/lines.js +4 -2
- package/src/primitives/pointset.js +7 -2
- package/src/primitives/zincObject.js +0 -1
- package/src/region.js +0 -2
- package/src/renderer.js +6 -1
- package/src/scene.js +1 -3
- package/src/sceneLoader.js +10 -6
- package/src/texture/textureArray.js +1 -1
- package/src/three/Geometry.js +45 -34
- package/src/three/Loader.js +1 -0
- package/src/three/line/Line.js +2 -2
- package/src/three/line/LineMaterial.js +432 -212
- package/src/three/line/LineSegments2.js +299 -151
- package/src/three/line/LineSegmentsGeometry.js +68 -20
- package/src/utilities.js +64 -3
- package/src/videoHandler.js +4 -1
package/src/utilities.js
CHANGED
|
@@ -685,8 +685,6 @@ function PhongToToon(materialIn) {
|
|
|
685
685
|
if (materialIn.isMeshPhongMaterial) {
|
|
686
686
|
let material = new THREE.MeshToonMaterial({
|
|
687
687
|
color : materialIn.color.clone(),
|
|
688
|
-
morphTargets : materialIn.morphTargets,
|
|
689
|
-
morphNormals : materialIn.morphNormals,
|
|
690
688
|
vertexColors : materialIn.vertexColors,
|
|
691
689
|
transparent : materialIn.transparent,
|
|
692
690
|
opacity : materialIn.opacity,
|
|
@@ -732,10 +730,11 @@ function getCircularTexture() {
|
|
|
732
730
|
|
|
733
731
|
function createNewSpriteText(text, height, colour, font, pixel, weight) {
|
|
734
732
|
const sprite = new SpriteText(text, height, colour, font, pixel, weight);
|
|
733
|
+
sprite.canvasScale = 4;
|
|
735
734
|
sprite.fontFace = font;
|
|
736
735
|
sprite.fontSize = pixel;
|
|
737
736
|
sprite.fontWeight = weight;
|
|
738
|
-
sprite.material.map.generateMipmaps =
|
|
737
|
+
sprite.material.map.generateMipmaps = true;
|
|
739
738
|
sprite.material.map.anisotropy = 4;
|
|
740
739
|
sprite.material.sizeAttenuation = false;
|
|
741
740
|
sprite.material.alphaTest = 0.5;
|
|
@@ -822,12 +821,74 @@ function removeVertexAtIndex(geometry, index, maintainLength) {
|
|
|
822
821
|
}
|
|
823
822
|
|
|
824
823
|
return removed;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
function copyVector2sArray(attribute, vectors) {
|
|
827
|
+
const array = attribute.array;
|
|
828
|
+
let offset = 0;
|
|
829
|
+
|
|
830
|
+
for (let i = 0; i < vectors.length; i++) {
|
|
831
|
+
const v = vectors[i];
|
|
832
|
+
array[offset++] = v.x;
|
|
833
|
+
array[offset++] = v.y;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
attribute.needsUpdate = true;
|
|
837
|
+
return attribute;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
function copyVector3sArray(attribute, vectors) {
|
|
841
|
+
const array = attribute.array;
|
|
842
|
+
let offset = 0;
|
|
843
|
+
|
|
844
|
+
for (let i = 0; i < vectors.length; i++) {
|
|
845
|
+
const v = vectors[i];
|
|
846
|
+
array[offset++] = v.x;
|
|
847
|
+
array[offset++] = v.y;
|
|
848
|
+
array[offset++] = v.z;
|
|
849
|
+
}
|
|
825
850
|
|
|
851
|
+
attribute.needsUpdate = true;
|
|
852
|
+
return attribute;
|
|
826
853
|
}
|
|
827
854
|
|
|
855
|
+
function copyVector4sArray(attribute, vectors) {
|
|
856
|
+
const array = attribute.array;
|
|
857
|
+
let offset = 0;
|
|
858
|
+
|
|
859
|
+
for (let i = 0; i < vectors.length; i++) {
|
|
860
|
+
const v = vectors[i];
|
|
861
|
+
array[offset++] = v.x;
|
|
862
|
+
array[offset++] = v.y;
|
|
863
|
+
array[offset++] = v.z;
|
|
864
|
+
array[offset++] = v.w;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
attribute.needsUpdate = true;
|
|
868
|
+
return attribute;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
function copyColorsArray(attribute, colors) {
|
|
872
|
+
const array = attribute.array;
|
|
873
|
+
let offset = 0;
|
|
874
|
+
|
|
875
|
+
for (let i = 0; i < colors.length; i++) {
|
|
876
|
+
const c = colors[i];
|
|
877
|
+
array[offset++] = c.r;
|
|
878
|
+
array[offset++] = c.g;
|
|
879
|
+
array[offset++] = c.b;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
attribute.needsUpdate = true;
|
|
883
|
+
return attribute;
|
|
884
|
+
}
|
|
828
885
|
|
|
829
886
|
export {
|
|
830
887
|
copyMorphColorsToBufferGeometry,
|
|
888
|
+
copyColorsArray,
|
|
889
|
+
copyVector2sArray,
|
|
890
|
+
copyVector3sArray,
|
|
891
|
+
copyVector4sArray,
|
|
831
892
|
createBufferGeometry,
|
|
832
893
|
createNewSpriteText,
|
|
833
894
|
createNewURL,
|
package/src/videoHandler.js
CHANGED
|
@@ -59,7 +59,10 @@ const VideoHandler = function(srcIn) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
this.setMorphTime = function(time, duration){
|
|
62
|
-
|
|
62
|
+
let actualTime = time / duration * _this.video.duration;
|
|
63
|
+
if (!Number.isFinite(actualTime)) {
|
|
64
|
+
actualTime = 0.0;
|
|
65
|
+
}
|
|
63
66
|
_this.video.currentTime = actualTime;
|
|
64
67
|
}
|
|
65
68
|
|