Skip to content

Commit 288e709

Browse files
committed
apply world coordinate
1 parent b7bfd7a commit 288e709

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

package-lock.json

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"gl-select-box": "^1.0.2",
8585
"gl-spikes2d": "^1.0.1",
8686
"gl-streamtube3d": "^1.1.1",
87-
"gl-surface3d": "^1.3.8",
87+
"gl-surface3d": "git://github.com/gl-vis/gl-surface3d.git#7fd01b7ba97bb6b09023bf9f97430081ac72eccc",
8888
"gl-text": "^1.1.6",
8989
"glslify": "^6.3.1",
9090
"has-hover": "^1.0.1",

src/traces/surface/convert.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ proto.handlePick = function(selection) {
9494
var v = selection.dataCoordinate[i];
9595
if(v !== null && v !== undefined) {
9696
selection.dataCoordinate[i] *= this.scene.dataScale[i];
97-
selection.dataCoordinate[i] -= this.midValues[i];
9897
}
9998
}
10099

@@ -474,15 +473,6 @@ proto.update = function(data) {
474473

475474
coords.push(intensity);
476475
}
477-
else {
478-
// when 'z' is used as 'intensity',
479-
// we must scale and translate its value
480-
params.intensityBounds[0] *= scaleFactor[2];
481-
params.intensityBounds[1] *= scaleFactor[2];
482-
483-
params.intensityBounds[0] -= this.midValues[2];
484-
params.intensityBounds[1] -= this.midValues[2];
485-
}
486476

487477
if(MAX_RESOLUTION < coords[0].shape[0] ||
488478
MAX_RESOLUTION < coords[0].shape[1]) {
@@ -544,6 +534,18 @@ proto.update = function(data) {
544534
params.vertexColor = true;
545535
}
546536

537+
params.worldOffset = [
538+
data._worldOffset[0],
539+
data._worldOffset[1],
540+
data._worldOffset[2]
541+
];
542+
543+
params.worldScale = [
544+
scaleFactor[0],
545+
scaleFactor[1],
546+
scaleFactor[2]
547+
];
548+
547549
params.coords = coords;
548550
surface.update(params);
549551

0 commit comments

Comments
 (0)