Skip to content

Commit b5c9827

Browse files
committed
Merge pull request plotly#571 from monfera/fix-brain
Fix to the default light positioning for the surface rendering case
2 parents 51228fb + c64fdac commit b5c9827

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed

src/traces/surface/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ module.exports = {
161161
role: 'style',
162162
min: -1e5,
163163
max: 1e5,
164-
dflt: 1e5,
164+
dflt: 1e4,
165165
description: 'Numeric vector, representing the Y coordinate for each vertex.'
166166
},
167167
z: {

src/traces/surface/convert.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,7 @@ proto.update = function(data) {
335335
}
336336

337337
if('lightposition' in data) {
338-
if(surface.lightPosition === void(0)) {
339-
surface.lightPosition = [data.lightposition.x, data.lightposition.y, data.lightposition.z];
340-
} else {
341-
surface.lightPosition.x = data.lightposition.x;
342-
surface.lightPosition.y = data.lightposition.y;
343-
surface.lightPosition.z = data.lightposition.z;
344-
}
338+
surface.lightPosition = [data.lightposition.x, data.lightposition.y, data.lightposition.z];
345339
}
346340

347341
if(alpha && alpha < 1) {
46.2 KB
Loading

test/image/mocks/gl3d_surface-lighting.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@
513513
"lightposition": {
514514
"x": 1e5,
515515
"y": 1e5,
516-
"z": 1e5
516+
"z": 1e4
517517
},
518518
"lighting": {
519519
"fresnel": 0.2,

0 commit comments

Comments
 (0)