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

Thread: Detchersville

  1. #21
      RobA is offline
    Administrator RobA's Avatar
    Join Date
    Apr 2007
    Location
    Niagara, Canada
    Posts
    5,532

    Default

    So when do we get the script?

    -Rob A>

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

    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
      Alfar is offline
    Guild Adept Alfar's Avatar
    Join Date
    May 2009
    Location
    Denmark
    Posts
    272

    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
      Alfar is offline
    Guild Adept Alfar's Avatar
    Join Date
    May 2009
    Location
    Denmark
    Posts
    272

    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
      Alfar is offline
    Guild Adept Alfar's Avatar
    Join Date
    May 2009
    Location
    Denmark
    Posts
    272

    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 Detchersville-detcher6_source.jpg   Detchersville-detcher6_done.jpg  

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

    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
  •