Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Voroni Diagram (SOLVED)  (Read 351 times)
newborn
Customers
Community Member
*****
Posts: 2422


WWW
« on: July 05, 2008, 02:10:37 PM »

I'm fooling around with landscape generation. so far so good, until I hit the Voroni diagram... For simplicity purpose, I generated a diagram without any equation and it seems to work properly (left image). However, the code I found (Mietze's & others) gives me a weird result (right image).



On Left:
distanceBuffer(x, y) = nearestDistance

On right:
distanceBuffer(x, y) = nearestDistance2 - nearestDistance


But there is something that bothers me in this:
Code:
If nearestDistance < minimumDistance Then minimumDistance = nearestDistance
If nearestDistance > maximumDistance Then maximumDistance = nearestDistance

For x As Integer = 0 To tableSizeX
    For y As Integer = 0 To tableSizeY
        pixel(x, y) = (distanceBuffer(x, y) - minimumDistance) / (maximumDistance - minimumDistance)
    Next
Next

If I'm using 2 distances, how come I'm only using minimum and maximum distance from distance #1?


I'm trying to acheive this:

http://www.blackpawn.com/texts/cellular/default.html
« Last Edit: July 05, 2008, 07:19:07 PM by newborn » Logged

newborn
Customers
Community Member
*****
Posts: 2422


WWW
« Reply #1 on: July 05, 2008, 07:18:52 PM »

Aight, fixed...

Logged

Mietze
Community Member
*
Posts: 223


« Reply #2 on: July 06, 2008, 05:36:06 AM »

ure sure you have converted it 1:1? Smiley
Logged
newborn
Customers
Community Member
*****
Posts: 2422


WWW
« Reply #3 on: July 06, 2008, 07:55:43 AM »

ure sure you have converted it 1:1? Smiley

nah, I had to add couple of new features. but yes, your code works well Smiley
Logged

Mietze
Community Member
*
Posts: 223


« Reply #4 on: July 06, 2008, 08:13:39 AM »

im glad to hear that Smiley
Logged
newborn
Customers
Community Member
*****
Posts: 2422


WWW
« Reply #5 on: July 06, 2008, 09:20:13 PM »

I'm stuck on the erosion now... Not sure if I should go with the thermal, hydraulic or the new one suggested by oddlabs called velocity.

which one are you using mietze?
Logged

Mietze
Community Member
*
Posts: 223


« Reply #6 on: July 07, 2008, 01:29:56 AM »

this is the hydraulic one, which is actually the simplest way Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks