Skip to content

Commit c210505

Browse files
committed
Updated examples to match previous version more closely. See #14537.
1 parent 9be88d0 commit c210505

File tree

5 files changed

+27
-8
lines changed

5 files changed

+27
-8
lines changed

examples/webgl_geometry_colors.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<style>
88
body {
99
color: #808080;
10-
font-family:Monospace;
11-
font-size:13px;
12-
text-align:center;
10+
font-family: Monospace;
11+
font-size: 13px;
12+
text-align: center;
1313

1414
background-color: #fff;
1515
margin: 0px;
@@ -134,7 +134,7 @@
134134
color.setHSL( 0, ( positions2.getY( i ) / radius + 1 ) / 2, 0.5 );
135135
colors2.setXYZ( i, color.r, color.g, color.b );
136136

137-
color.setRGB( 1, 1, ( positions3.getY( i ) / radius + 1 ) / 2 );
137+
color.setRGB( 1, 0.8 - ( positions3.getY( i ) / radius + 1 ) / 2, 0 );
138138
colors3.setXYZ( i, color.r, color.g, color.b );
139139

140140
}

examples/webgl_multiple_canvases_complex.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
color.setHSL( 0, ( positions2.getY( i ) / radius + 1 ) / 2, 0.5 );
197197
colors2.setXYZ( i, color.r, color.g, color.b );
198198

199-
color.setRGB( 1, 1, ( positions3.getY( i ) / radius + 1 ) / 2 );
199+
color.setRGB( 1, 0.8 - ( positions3.getY( i ) / radius + 1 ) / 2, 0 );
200200
colors3.setXYZ( i, color.r, color.g, color.b );
201201

202202
}

examples/webgl_multiple_canvases_grid.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214
color.setHSL( 0, ( positions2.getY( i ) / radius + 1 ) / 2, 0.5 );
215215
colors2.setXYZ( i, color.r, color.g, color.b );
216216

217-
color.setRGB( 1, 1, ( positions3.getY( i ) / radius + 1 ) / 2 );
217+
color.setRGB( 1, 0.8 - ( positions3.getY( i ) / radius + 1 ) / 2, 0 );
218218
colors3.setXYZ( i, color.r, color.g, color.b );
219219

220220
}

examples/webgl_multiple_renderers.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
color.setHSL( 0, ( positions2.getY( i ) / radius + 1 ) / 2, 0.5 );
129129
colors2.setXYZ( i, color.r, color.g, color.b );
130130

131-
color.setRGB( 1, 1, ( positions3.getY( i ) / radius + 1 ) / 2 );
131+
color.setRGB( 1, 0.8 - ( positions3.getY( i ) / radius + 1 ) / 2, 0 );
132132
colors3.setXYZ( i, color.r, color.g, color.b );
133133

134134
}
@@ -184,6 +184,25 @@
184184
mesh2.rotation.z += Math.PI / 500;
185185
mesh3.rotation.z += Math.PI / 500;
186186

187+
var position = new THREE.Vector3();
188+
var color = new THREE.Color();
189+
190+
var time = performance.now() / 500;
191+
192+
var positions = mesh3.geometry.attributes.position;
193+
var colors = mesh3.geometry.attributes.color;
194+
195+
for ( var i = 0, l = positions.count; i < l; i ++ ) {
196+
197+
position.fromArray( positions.array, i * 3 );
198+
199+
color.setRGB( 1, Math.sin( time + position.x ), Math.cos( time * 2.123 + position.x ) );
200+
colors.setXYZ( i, color.r, color.g, color.b );
201+
202+
}
203+
204+
colors.needsUpdate = true;
205+
187206
//
188207

189208
var time = performance.now() / 2000;

examples/webgl_multiple_views.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
color.setHSL( 0, ( positions2.getY( i ) / radius + 1 ) / 2, 0.5 );
186186
colors2.setXYZ( i, color.r, color.g, color.b );
187187

188-
color.setRGB( 1, 1, ( positions3.getY( i ) / radius + 1 ) / 2 );
188+
color.setRGB( 1, 0.8 - ( positions3.getY( i ) / radius + 1 ) / 2, 0 );
189189
colors3.setXYZ( i, color.r, color.g, color.b );
190190

191191
}

0 commit comments

Comments
 (0)