PatrickMurphy / mapBuilding

0 stars 0 forks source link

Buildings and Trees not placed on the ground #2

Closed PatrickMurphy closed 7 years ago

PatrickMurphy commented 7 years ago

The trees are placed at the Vertex height of one of the corners of the cell, if it is going down slope it floats above it etc. Either extend models lower, or find point on terrain between slope. Could ray cast a ray up and down at the center point of the cell and find the intersection with the terrain.

PatrickMurphy commented 7 years ago

Fixed in commit ca38be29e77f265af784deea7beed56ad864c215

Using the scalar equation of the planes with in each cell the getHeightAt(x,y) functions return the z value at an x,y I used this to place the trees, and each point of the base of the buildings to reduce floating objects