Using ONLY three.js and NO external libraries like Cannon.js or ammo.js, write code that creates a realistic animated 3D construction crane made of basic primitives like boxes and cylinders. Use THREE.Group() to create a hierarchy of parts. It should include:
- A rotating base or cab
- An arm that rotates (like a boom)
- A telescoping or extendable part of the arm
- A cable or hook that can lower and raise (faked with transforms, not physics)
Each of these articulated parts should be defined as separate groups so that they can rotate or move independently. Please use named variables for the parts and add comments explaining the hierarchy and which part controls which. Keep code readable and DO NOT use loaders, GLTF, OBJ, or external geometry—only primitives.
The scene should include basic lighting and a ground plane. No need for orbit controls. Don’t use any physics engines or complex loaders. The focus should be on modeling the articulation hierarchy correctly.
Make sure the hook extends downward from the arm and can be animated manually.