Each tree of the first map's forest stands with its base on the ground all round, on any slope #19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3930-trees-on-hills-float-each-stands-with-it"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracker: #3930
On hills each tree's root flare hung in the air on its downhill side.
first_map_prefabs.pystood every tree with its origin on the ground under its centre, and a scanned tree's base is shaped for the flat ground it was scanned on.What changes
assets/scenes/first_map_prefabs.pystands each tree with its origin at the lowest ground under its base: the vertices its prefab draws lower than 0.5 m above its origin, turned and scaled as the tree is. Its base then meets the ground all round, with its uphill side in the ground. Every tree keeps its place, turn and scale; only its height changes.assets/scenes/first_map.blendhas the script run over it again.tests/first_map_world.sxchecks every tree's base vertices (those lower than 0.5 m in its prefab). Under each one, the ground the tree stood on in its prefab may lie at most 3 cm above the map's own ground (the meshes the map draws as themselves), and under at least one of them at most 3 cm below it. So a base that hovers fails, and so does a tree sunk past where its base touches the ground. The ground is read by a ray down from above the map.tests/pixels/forest-metal.pngis the forest view regenerated: the near fir stands lower.first_map.blend.mdand the script's header say how the trees stand.How the test reads the ground
The task's probe cast its ray down from each vertex itself, into the world file. For an uphill vertex that lies below the ground, that ray meets the tree's own trunk proxy, which reaches 1 m below the base. Its worst figures (0.84 m and 1.03 m) are those buried vertices. Read from above on the map's own ground, master's worst hovers are 0.52 m for a fir and 0.29 m for an island tree. Blender's own measurement of each tree against the terrain gives the same figures.
Evidence
Test at master's bake (a
git archiveof master, baked, with this test copied in): fails.every fir_tree_01's base meets the ground, not 540 of 603: the worst hovers 0.519531 mevery island_tree_02's base meets the ground, not 230 of 297: the worst hovers 0.291107 mTest at this head: passes. Every tree's highest base vertex lies within 0.000022 m of the ground, above or below (read with the bound set to 0 in a scratch copy of the test).
The render file compared with master's, decoded, with each texture taken by its content: the only change is the hulken y of the tree transforms. 603 firs are lowered by 1.8 mm to 0.520 m and 297 island trees by 1.8 mm to 0.291 m. Nothing else moves.
Trunk proxies. In the world file, only the 900 proxies' 19,800 triangles move, each corner straight down by exactly its own tree's drop. So each proxy still stands round its trunk. The trunk walk in
tests/first_map_world.sxpasses, so a fir's trunk still blocks a player.Mutants of the script's rule each fail the test. Each was run over a copy of the committed
.blendin agit archivearm, then baked and tested:Rerunning the script unchanged over the committed
.blendbakes a render file and a world file byte-identical to this head's.Renders from 6 m down the slope, at master and at this head, are attached to #3930:
At master the root flare hangs in the air; here the trunk enters the ground.
Gates
sak-gate fastated268b2: passed, 34 of 34 (run 1831's gate #1, tracker gate run 903).sak-gate fullated268b2: passed, 34 of 34 (run 1831's gate #2, tracker gate run 904).sak-gate fullat4715171: passed, 34 of 34 (run 1840's gate #1, tracker gate run 909).