MCPcopy
hub / github.com/regl-project/regl / drawMeshes

Function drawMeshes

example/point-light-shadow.js:252–288  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

250
251regl.frame(({ tick }) => {
252 var drawMeshes = () => {
253 regl.clear({
254 color: [0, 0, 0, 255],
255 depth: 1
256 })
257 var i
258 var theta
259 var R
260 var r, g, b
261 var phi0 = 0.01 * tick
262
263 var phi1 = -0.006 * tick
264
265 for (i = 0; i < 1.0; i += 0.1) {
266 theta = Math.PI * 2 * i
267 R = 20.0
268
269 r = ((Math.abs(23232 * i * i + 100212) % 255) / 255) * 0.4 + 0.3
270 g = ((Math.abs(32278 * i + 213) % 255) / 255) * 0.4 + 0.15
271 b = ((Math.abs(3112 * i * i * i + 2137 + i) % 255) / 255) * 0.05 + 0.05
272
273 bunnyMesh.draw({ scale: 0.7, translate: [R * Math.cos(theta + phi0), 3.0, R * Math.sin(theta + phi0)], color: [r, g, b] })
274 }
275
276 for (i = 0; i < 1.0; i += 0.15) {
277 theta = Math.PI * 2 * i
278 R = 35
279
280 r = ((Math.abs(23232 * i * i + 100212) % 255) / 255) * 0.4 + 0.05
281 g = ((Math.abs(32278 * i + 213) % 255) / 255) * 0.3 + 0.4
282 b = ((Math.abs(3112 * i * i * i + 2137 + i) % 255) / 255) * 0.4 + 0.4
283
284 boxMesh.draw({ scale: 4.2, translate: [R * Math.cos(theta + phi1), 9.0, R * Math.sin(theta + phi1)], color: [r, g, b] })
285 }
286
287 planeMesh.draw({ scale: 130.0, translate: [0.0, 0.0, 0.0], color: [1.0, 1.0, 1.0] })
288 }
289
290 globalScope(() => {
291 drawDepth(6, () => {

Callers 1

Calls 2

clearMethod · 0.80
drawMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…