AEROSIM-TS-32
Generate rendered terrain from normalized heights
The R3F flight scene generates its terrain geometry and elevation sampling from the normalized height-data contract.
- Verified flow state
- Done
- Owner
- AeroSim Architecture and Delivery
- Feature
- AEROSIM-FT-47
- Component
- Web Application — R3F terrain renderer
- Repository
- corp-v1-aerosim/corp-v1-aerosim
Delivery scope
Build one indexed BufferGeometry from NormalizedHeightData, map each grid sample to a vertex, generate two triangles per cell with consistent winding, calculate normals and bounds, expose the same sampleHeight function, and dispose geometry on replacement. Primary files: applications/web/src/flight/terrain/TerrainMesh.tsx, applications/web/src/flight/terrain/build-terrain-geometry.ts, applications/web/tests/terrain/terrain-mesh.test.tsx.
Implementation contract
Implementation artifacts
- applications/web/src/flight/terrain/TerrainMesh.tsx
- applications/web/src/flight/terrain/build-terrain-geometry.ts
- applications/web/tests/terrain/terrain-mesh.test.tsx
Inputs
- NormalizedHeightData from @aerosim/flight-core
- TerrainMaterialConfig {color,roughness,metalness}
Outputs
- Three.js BufferGeometry with width*height vertices and (width-1)*(height-1)*6 indices
- R3F TerrainMesh positioned at the HeightData origin
Failure boundaries
- Do not allocate geometry if index count exceeds the supported typed-index range or normalized samples are absent.
- Dispose the previous BufferGeometry exactly once when height data changes or the component unmounts.
Excluded scope
- Textures, vegetation, level-of-detail tiles, erosion, and Rapier colliders are not produced by this renderer task.
Verification steps
- pnpm --filter @aerosim/web test -- terrain/terrain-mesh.test.tsx
- For ridge-5x5 assert 25 vertices, 96 indices, expected corner/peak world positions, finite normals, and disposal after replacement.
Traceability
Dependencies
- AEROSIM-TS-31Canonical ID: TASK-0031
UI/UX applicability
non_visual
This Task owns technical or behavioral acceptance and does not claim direct visual conformance to the approved UI/UX package.
Acceptance evidence
Verified delivery: application PR #60 merged normalized-height terrain geometry as b3d134b9a7261411b71e2fef552408c38da524eb; current integration retains the required renderer, geometry builder, and tests; the focused terrain-mesh suite passes 6/6; exact-head integration validation and immutable image publication passed remotely at ade1706b80d1642a6763f2827cfb2e6b3fc8ddaf. Release completion verified on product 1.0.0.0 at GitOps revision 5d3712d89dfbf7dacd993348e55f497d126c7bf9 with Argo Synced/Healthy, exact image digests, authenticated API/database access, and three-world configured-flight acceptance.
Current evidence boundary
No current implementation, acceptance, release, or deployment evidence is claimed for this planned Task. Any prior implementation may be used only as prototype and discovery evidence.