Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: Detchersville

  1. #21

  2. #22
    Guild Adept Alfar's Avatar
    Join Date
    May 2009
    Location
    Denmark
    Posts
    276

    Post

    Heh.

    yeah, I wanted to do a bunch of other stuff too. Got sidetracked trying to make a "Basin fill" function. It works to some degree (In that it does seem to fill some holes, not sure my algorithm matches the requirements), but is way too slow to be useful. It was interesting to work with the pixel stuff in python-fu, though.

    My script does the following:
    1) start at a pixel.
    2) travel downhill (by red value) until there is no way to go down.
    3) travel uphill in four directions until the next move would take you downhill.
    4) fill all pixels you've visited in step 3 with the value of the lowest edge you found.
    5) find the next unvisited pixel.
    6) Start over until there are no unvisited pixels.

    I'm sure there's a clever way to accomplish this. Eventually, I hope to make a river-placer out of it. Heh. C&C are welcome.

    I have the house placing code on the other machine, will fix it up and post it shortly. Here's the basin fill script. Don't use it on anything larger than 200x200 unless you're a very patient person. I'm not one, so can't say if it'll actually work.
    Attached Files Attached Files

  3. #23
    Guild Adept Alfar's Avatar
    Join Date
    May 2009
    Location
    Denmark
    Posts
    276

    Post

    And here is the house mask script. Like I said, I still want to add stuff to this, but since you asked, here's a first version. C&C welcome.

    To use it, make a selection that you want houses around.

    I draw my streets white on black, then select the black, invert, grow by 35 (because I know my houses have a max radius about 30 pixels), then Filter|Map tools|Create houses mask

    It'll create a new layer of black with a layer mask that contains the houses, so when you hide the streets layer, you'll be able to see the house outlines.

    From there, duplicate layer, mask to selection, shaped gradient black to white, use that layer as a bump map on a 50% gray layer, overlay that on a roof-colored duplicate of the houses, offset and blur the original houses layer for drop shadow.

    Those steps are part of what will go into the script eventually.
    Attached Files Attached Files

  4. #24

  5. #25
    Guild Adept Alfar's Avatar
    Join Date
    May 2009
    Location
    Denmark
    Posts
    276

    Default

    Yeah, I was thinking about snagging some of that - since I actually have the precise angles of the houses, I'd be able to rotate the pattern specifically for each. Actually, that gave me an idea...

    I already select each house separately, so I guess it wouldn't be too hard to select it without rotation, floating the selection and then rotating it and applying it to a new layer? That way, I could have a layer with different patterns in different areas, and the houses would then have the pattern from the area they exist in, but rotated to follow the shape of the house. Whoa

    Comments? Ideas? Anything?

  6. #26
    Guild Adept Alfar's Avatar
    Join Date
    May 2009
    Location
    Denmark
    Posts
    276

    Wip An example may be in order

    Here's the latest output. I've added options to the script so I can now choose whether or not to use a patterns layer, and then choose which layer to use for patterns.

    That takes me from the first image to the second one, with a little manual work to bump map it and add road and background. Those can and will be scripted eventually.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	detcher6_source.jpg 
Views:	39 
Size:	101.0 KB 
ID:	14866   Click image for larger version. 

Name:	detcher6_done.jpg 
Views:	60 
Size:	55.1 KB 
ID:	14867  

  7. #27
    Guild Adept Alfar's Avatar
    Join Date
    May 2009
    Location
    Denmark
    Posts
    276

    Default

    And yes, I realize that your thatching script is better, in that it rotates the thatches according to the direction of the slopes, where my current version just rotates to the direction the house points. I guess if I refined my building definitions, I could do directions, and maybe even make a better bump map than the directional gradient does - it messes up in the 90 degree angles (or rather, it does what it's supposed to do, not what I want it to)

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •