Skip to content

Commit cc45972

Browse files
authored
Merge pull request #3415 from plotly/fix3353-light-reversed-ranges
Mesh3d lighting fix
2 parents cb9f9b0 + 9d70ef0 commit cc45972

10 files changed

+82
-10
lines changed

package-lock.json

+3-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"gl-heatmap2d": "^1.0.5",
7878
"gl-line3d": "^1.1.8",
7979
"gl-mat4": "^1.2.0",
80-
"gl-mesh3d": "^2.0.4",
80+
"gl-mesh3d": "^2.0.5",
8181
"gl-plot2d": "^1.4.1",
8282
"gl-plot3d": "^1.6.2",
8383
"gl-pointcloud2d": "^1.0.2",
Loading
Loading
40 Bytes
Loading

test/image/baselines/gl3d_snowden.png

-355 Bytes
Loading
737 Bytes
Loading
-888 Bytes
Loading
-204 Bytes
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"data": [
3+
{
4+
"x": [0, 0, 0, 1, 1, 1, 2, 2, 2],
5+
"y": [100, 101, 102, 100, 101, 102, 100, 101, 102],
6+
"z": [1.5, 1.5, 1.5, 1.5, 2.5, 3.5, 1.5, 3.5, 5.5],
7+
"type": "mesh3d",
8+
"color": "grey",
9+
"lighting": { "ambient": 0.5, "diffuse": 0.5, "specular": 0.5, "roughness": 0.5, "fresnel": 0.5 },
10+
"lightposition": { "x": 0, "y": 2000, "z": 1000 }
11+
},
12+
{
13+
"x": [0, 0, 0, 1, 1, 1, 2, 2, 2],
14+
"y": [100, 99, 98, 100, 99, 98, 100, 99, 98],
15+
"z": [1.5, 1.5, 1.5, 1.5, 2.5, 3.5, 1.5, 3.5, 5.5],
16+
"type": "mesh3d",
17+
"color": "grey",
18+
"lighting": { "ambient": 0.5, "diffuse": 0.5, "specular": 0.5, "roughness": 0.5, "fresnel": 0.5 },
19+
"lightposition": { "x": 0, "y": 2000, "z": 1000 }
20+
},
21+
{
22+
"x": [0, 0, 0, -1, -1, -1, -2, -2, -2],
23+
"y": [100, 99, 98, 100, 99, 98, 100, 99, 98],
24+
"z": [1.5, 1.5, 1.5, 1.5, 2.5, 3.5, 1.5, 3.5, 5.5],
25+
"type": "mesh3d",
26+
"color": "grey",
27+
"lighting": { "ambient": 0.5, "diffuse": 0.5, "specular": 0.5, "roughness": 0.5, "fresnel": 0.5 },
28+
"lightposition": { "x": 0, "y": 2000, "z": 1000 }
29+
},
30+
{
31+
"x": [0, 0, 0, -1, -1, -1, -2, -2, -2],
32+
"y": [100, 101, 102, 100, 101, 102, 100, 101, 102],
33+
"z": [1.5, 1.5, 1.5, 1.5, 2.5, 3.5, 1.5, 3.5, 5.5],
34+
"type": "mesh3d",
35+
"color": "grey",
36+
"lighting": { "ambient": 0.5, "diffuse": 0.5, "specular": 0.5, "roughness": 0.5, "fresnel": 0.5 },
37+
"lightposition": { "x": 0, "y": 2000, "z": 1000 }
38+
},
39+
{
40+
"x": [-2, -1, 0, 1, 2],
41+
"y": [98, 99, 100, 101, 102],
42+
"z": [
43+
[4, 2, 0, 2, 4],
44+
[2, 1, 0, 1, 2],
45+
[0, 0, 0, 0, 0],
46+
[2, 1, 0, 1, 2],
47+
[4, 2, 0, 2, 4]
48+
],
49+
"type": "surface",
50+
"colorscale": [[0, "grey"], [1, "grey"]],
51+
"showscale": false,
52+
"lighting": { "ambient": 0.5, "diffuse": 0.5, "specular": 0.5, "roughness": 0.5, "fresnel": 0.5 },
53+
"lightposition": { "x": 0, "y": 2000, "z": 1000 }
54+
}
55+
],
56+
"layout": {
57+
"height": 800,
58+
"width": 800,
59+
"title": {
60+
"text": "Mesh3d and surface lighting"
61+
},
62+
"scene": {
63+
"xaxis": {
64+
},
65+
"yaxis": {
66+
},
67+
"zaxis": {
68+
},
69+
"camera": {
70+
"eye": {
71+
"x": 2.0,
72+
"y": -1.5,
73+
"z": 0.5
74+
}
75+
}
76+
}
77+
}
78+
}

0 commit comments

Comments
 (0)