The following code shows an example of the declaration of the function that renders a sphere named renderSphere
and the function that renders a cube named renderCube
in JavaScript:
function renderSphere( x, y, z, radius, cameraX, cameraY, cameraZ, cameraDirectionX, cameraDirectionY, cameraDirectionZ, cameraVectorX, cameraVectorY, cameraVvectorZ, cameraPerspectiveFieldOfView, cameraNearClippingPlane, cameraFarClippingPlane, directionalLightX, directionalLightY, directionalLightZ, directionalLightColor) { } function renderCube( x, y, z, edgeLength, cameraX, cameraY, cameraZ, cameraDirectionX, cameraDirectionY, cameraDirectionZ, cameraVectorX, cameraVectorY, cameraVvectorZ, cameraPerspectiveFieldOfView, cameraNearClippingPlane, cameraFarClippingPlane, directionalLightX, directionalLightY, directionalLightZ, directionalLightColor) { }
Each function requires a huge number of parameters. Let's imagine...