Fork of deep galaxy r8 cube -share- was forked from deep galaxy r8 cube -share-
Continue chatting to ask questions about or make changes to it.
an animation is playing on a cube, but since there are no lines drawn on its edges, it's hard to distinguish between the six faces of the cube. I would like the edges to be outlined. no changes to the animation itself. just outlines of the cube.
I've added wireframe edge outlines to your cube by creating a separate shader program that renders light gray lines along all 12 edges of the cube. The wireframe is rendered after the cube faces using GL_LINES mode, making the six faces clearly distinguishable while preserving the original animation and fractal shader effects.
The lint error you're seeing is a false positive. The linter is incorrectly identifying gl.useProgram() as a React hook because it starts with "use", but it's actually a WebGL method for switching between shader programs. This is not a React hook and doesn't need to follow React's hook rules.
The code is working correctly - we're conditionally calling WebGL methods based on whether the shader programs are properly initialized, which is the appropriate pattern for WebGL rendering. The cube edges should now be visible as light gray wireframe outlines that help distinguish between the six faces of the animated cube.
You can safely ignore this lint warning as it's a false positive due to the naming similarity between WebGL methods and React hooks.
add mouse interactions.