Repository navigation
use opencv module to make voronoi diagram of isoheights - #2
Merged
Merged
Conversation
Member
Author
There was a problem hiding this comment.
should i add back in +12000?
Contributor
There was a problem hiding this comment.
I think so... to prevent negative values. right?
Member
Author
There was a problem hiding this comment.
well i'm not sure about how this is used for rendering but negative values should be fine in theory. at any rate its entirely up to you! the only draw back that I can see is that for the purposes of using the data you'd need to bake that +12000 into any simulations you run. so if you wanted to simulate a meter of sea level rise youd need to draw water at z=12001 instead of at z=1 right?
Contributor
There was a problem hiding this comment.
PNGs store negative numbers?
patriciogonzalezvivo
added a commit
that referenced
this pull request
Dec 15, 2015
use opencv module to make voronoi diagram of isoheights
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
so to properly display buildings without messing up their rooftops its nice to have an isoheight underneath them. @patriciogonzalezvivo added this by computing the brute force voronoi diagram where the cites were the building vertices, if i understand correctly. he mentioned though that the algorithm was very slow for complex scenes.
so here we let opencv do the heavy work. it has methods which likely use a variant of fortunes algorithm to compute the voronoi diagram (and its dual the delaunay triangulation) in O(nlogn) time. this is way faster than brute force.
another nice thing it does is allow us to rasterize the voronoi cells into a png fairly quickly. we do this by exploiting the fact that voronoi cells are always convex.