# Task: make a 30-second 3D archer battle scene Make a 3D battle scene that plays in a desktop or phone browser as a 30-second loop, with no words on screen and no sound. A wooden frontier fort is under attack: archers on two wooden watchtowers shoot volleys of arrows at a wall of pikemen with round shields who march toward them. The arrows fly in high arcs and strike the shields: some stick in the wood, some glance off, and each shield jolts with the hit. Smoke drifts over the field, and every impact throws up sparks, splinters or dust. Write `index.html` in this folder. You may add more `.js` and `.css` files here. The page will be opened from a local web server (for example `http://localhost:8000/index.html`). ## The scene Units are metres, +Y is up, the ground is at y = 0 and +X points east. - **The fort (west).** A palisade of sharpened upright logs, 4 m tall, along x = −18 from z = −16 to z = 16. Behind it stand two wooden watchtowers, centred at (−21, 0, −7) and (−21, 0, 7). Each has log legs with cross-bracing and rope lashings, a ladder, a plank platform about 4 × 4 m at 9 m height with a rail, and a roof. A fire basket smokes on each platform. - **The archers.** Three on each platform, six in all, each with a bow and a quiver. They draw, aim and loose in volleys. - **The pikemen (east).** Sixteen in two ranks of eight, 1.2 m apart, centred on z = 0 and facing west. Each holds a round wooden shield about 0.8 m across, with a metal rim and boss, in front of the body, and a pike about 4 m long held upright. The front rank starts at x = 24 and marches west at 0.4 m/s, reaching x = 12 at 30 s. The second rank keeps 1.5 m behind it. - **The soldiers.** Shape them as people about 1.8 m tall, with helmets, clothing and armour, and give the two sides clearly different colours. Their limbs move: archers draw and release, and pikemen march in step. - **The setting.** Late afternoon: a low, warm sun with long shadows, a hazy sky, grass and trampled earth, and distant hills. Put no object within 2 m of the camera path below. ## What must happen 1. The archers loose at least 24 arrows over the loop, in volleys. Each arrow flies a real ballistic arc under gravity (9.81 m/s²), its point always leading along its path. Each flight to the shield wall takes about 2–3 s. 2. Most arrows strike shields. An arrow that hits either sticks in the shield where it struck, at the angle it arrived, and moves with the shield from then on, or glances off and falls to the ground. Every shield that is hit visibly jolts back and wobbles. Arrows that miss stick into the ground. 3. Time the volleys so that arrows are seen leaving the bows while the camera is behind the archers (8–12 s) and strike the shield wall while the camera is close to it (13–24 s). 4. Smoke rises and drifts from the fire baskets, a thin haze crosses the field, and both keep moving. Every impact throws sparks (metal), splinters (wood) or dust (ground), and marching feet kick up dust. 5. Nothing passes through anything else. Arrows stop at whatever they hit, soldiers keep apart and stand on the ground, and nothing crosses the palisade or the towers. 6. Make it look as good as you can: the lighting, real-time shadows, materials such as wood grain, rope, cloth and metal, and the smoke and particles. 7. A 16:9 picture that fits the window in landscape and in portrait, letterboxed if needed. Aim for smooth playback at 60 frames per second. ## The camera Use exactly this camera, so that every run shows the same view: a perspective camera with a 45° vertical field of view and +Y up, placed at a position and looking at a target. At film time t (seconds), between two keys A and B: u = (t − tA) / (tB − tA), s = u × u × (3 − 2 × u), position = A.position + (B.position − A.position) × s, and the target the same way. The camera makes no other moves, shakes or cuts. | t (s) | position (x, y, z) | target (x, y, z) | shot | |---|---|---|---| | 0 | (2, 24, 48) | (0, 3, 0) | wide, from the south | | 6 | (−34, 14, 18) | (−21, 9, 7) | the south tower | | 10 | (−28, 14, 14) | (6, 4, 0) | behind the archers | | 15 | (11, 1.9, 6) | (17.5, 1.4, 0) | low, at the shield wall | | 21 | (11, 1.7, −7) | (15.5, 1.3, 0) | along the shield wall | | 26 | (2, 24, 48) | (0, 3, 0) | wide again, held to 30 s | Each frame, after placing the camera, set `window.filmCamera = { t, position: [x, y, z], target: [x, y, z] }` to the values you render with. The test reads it. ## Timing - Film time starts at 0 on the first animation frame, and everything (camera, soldiers, arrows, smoke) follows it. At 30 s the loop restarts with a hard cut back to the opening. Do not fade to black. - Drive all animation from `requestAnimationFrame`, with the film's time taken from its timestamp or `performance.now()`, so the scene runs at the same speed on any machine. - Use a seeded pseudo-random generator, not `Math.random()`, so every loop plays the same. ## Rules - Draw the scene in 3D with WebGL that you write yourself, or with the Three.js copy in `vendor/three/` (version 0.187.0), through this import map: ```html ``` No CDN, no other libraries, no network requests of any kind, no external fonts, image, audio, video or model files (make any textures and shapes in code). No sound. - Everything must be original: no logos, lettering, flags or emblems of any real brand, team or country, and nothing modelled on characters or designs from existing games, films or toys. - Do not change anything in `vendor/`. - You can read and write files in this folder only. You cannot open a browser or run commands, so you cannot preview the page: check your code carefully. - Work on your own until it is done; nobody will answer questions. When you finish, reply with a short summary of what you made.