MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / animate

Function animate

apps/baseai.dev/src/components/home/webgl-fast-scaled-1.tsx:376–390  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

374
375 // Animation loop
376 const animate = () => {
377 requestAnimationFrame(animate);
378 material.uniforms.u_time.value += 0.02; // Update time for animation (doubled speed)
379 material.uniforms.u_viewVector.value = camera.position;
380 // sphere.rotation.y += 0.004; // Doubled rotation speed
381
382 // Update mouse position in the shader
383 raycaster.setFromCamera(mouse, camera);
384 const intersects = raycaster.intersectObject(sphere);
385 if (intersects.length > 0) {
386 material.uniforms.u_mouse.value = intersects[0].point;
387 }
388
389 renderer.render(scene, camera);
390 };
391
392 animate();
393

Callers 1

WebGLInitializerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected