Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 32

Thread: Yet Another Town Generator (3D)

  1. #11

    Default

    So many languages... I felt I could spend a week analysing which to use but ultimately a friend reckoned Python was worth a shot.
    The job I need the Python code to do is basically very simple, in theory. I need to be able to load a height_field image but not necessarily modify it, just have it as the background. Then I need to be able to plot points, Nodes, in just the x-z plane (y is up). These need to have default automatic "name idents" with the option to assign your own. Then I need to be able to connect such nodes in pairs, and assign some other variables for each connection. Lastly I need to be able to define triplets and other parameters for those.
    The program holds and displays all that data - with possible nice extras like filters and colour coding and so on and ultimately be able to save that data in its own format and also export as pre-defined text strings into a POVRay text file. There's no rendering up to this point, just a few numbers and text strings.

    As for the rendering - that's where the second phase comes in and I fire up povray, and run the exported pov file from the Python program.
    However, unlike in the Competition, I've been careful to try and keep the render time down. The Nexus took ages on one or two of the renders because of the light beams, which are not needed here. The current textured view of "Bendford" takes about 10 minutes, less if you only want to check layouts using the low detail setting (the yellow and red building versions you can see on the website).

    Anyway, it's a challenge, but not enough that I would say "no" to anyone wanting to take it over - in any language!
    --
    "I do not know whether I was then a man dreaming I was a butterfly, or whether I am now a butterfly dreaming I am a man"

    My Finished Stuff
    ............. Some of my 3D Stuff (POVRay)

  2. #12
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,193
    Blog Entries
    8

    Default

    Well my advice is to go with python and wxPython GUI and the image magick python interface which makes loading/saving an image, plotting lines and points a doddle.

    http://www.imagemagick.org/script/index.php
    http://www.imagemagick.org/download/python/
    http://www.imagemagick.org/Usage/

  3. #13

    Default

    Now THAT is just what the Doc ordered I think!!! I dunno what my rep stick does but here goes! Thanks indeed!
    --
    "I do not know whether I was then a man dreaming I was a butterfly, or whether I am now a butterfly dreaming I am a man"

    My Finished Stuff
    ............. Some of my 3D Stuff (POVRay)

  4. #14

    Default

    An update.
    I'm still on the case, as it were, but progress is slow as I learn Python - or try to. I've cobbled together a quickie App that loads a height field into a scrolling window - mostly by cribbing existing programs. I'm also writing up a better Interface Control Doc for the software dialogue boxes and eventual exported POV text commands which in itself is helping me rationalise the way it works - or should work.
    I had a session trying to get ImageMagick included within the Python environment and hit a stumbling block in that there doesn't seem to be a Python/IDLE environment installer, just a windows command line bin installer... any clues here would be helpful! In the meantime I'm looking at it from a Pickle angle but I'm not sure if that will support multiple vector line "rubberbanding" when one moves a single Node connected with several lines... ugh. That may have to be "mandraulic".
    It's easy to get distracted from this! In the meantime, I'm using Boa to design the dialogue frames and define the main code structure, after that it looks like plain old text editing in IDLE for the "meat" of the code.
    Here's a screen shot of my height field view test program just because, really...
    Click image for larger version. 

Name:	viewer.jpg 
Views:	51 
Size:	76.9 KB 
ID:	28193

    Not forgotten, just delayed...
    --
    "I do not know whether I was then a man dreaming I was a butterfly, or whether I am now a butterfly dreaming I am a man"

    My Finished Stuff
    ............. Some of my 3D Stuff (POVRay)

  5. #15
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,193
    Blog Entries
    8

    Default

    I cant help much with how you install or embed IM into python. I can help with a utility for looking at height maps tho.

    Attachment 28196

  6. #16

    Default

    That's fine, I had a look at ViewingDale in my various researches, very nice tool! The height field part of my project is the simplest bit and being able to view as a plan view is about all I need. I'm not competing with the abilities of VD or Wilbur and the like in height field abilities. All I need is to be able to see the heightfield, much as my screenshot shows it (although more choice of colours schemes would be fun later). That overhead view is basically the backdrop on which to plot the town items so that you don't put a ship in the market square or run a street up a cliff face or something. That means that the "plot screen" for nodes and lines for these things needs to scroll locked with the height field - synchronised.
    Creation of the height field itself is outside the scope of the Town Generator and viewing it at angles, while handy, is a low priority since the adjustment of town objects to sit at the correct height at the point of presence is done within "YATG3D" as part of the POVray code. In essence the GUI front end works on a "flat" world - for the foreseeable future!
    However, I'm not at a point where I'm committed to using Python, so if wx can do the things I need and I can't get wx in Python, well, maybe a change to a different language is in order... ooooer.
    --
    "I do not know whether I was then a man dreaming I was a butterfly, or whether I am now a butterfly dreaming I am a man"

    My Finished Stuff
    ............. Some of my 3D Stuff (POVRay)

  7. #17
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,193
    Blog Entries
    8

    Default

    ViewingDale, the main app, isn't 3D and doesn't use height maps thats just a little free thing used to look at them which are spat out from the other free tool instant islands used to make some real basic land masses. You can grab that and use it without having to buy or do anything. It's closed source freeware. I also use height maps to texture up backdrops but I use a different (and unfortunately unreleased) tool for that.

    The scroll locked thing you can do by either offsetting the draw list of lines to the same offset for the map and then rendering out a section of it. Or, and more usually, you render the whole screen and put it into a scrollable window which shows only part of it. If I were doing this sort of thing then I would use a 3rd technique which is similar to the second and use windows MFC classes and GDI to draw the bitmap and lines and then copy a section to a displayable screen bit. Tho no hard, theres still a lot to know to do it tho. Id still think you would be better off using perl. Install any V5 32bit version and then install the image magick module by typing:
    Code:
    ppm install http://www.bribes.org/perl/ppm/Image-Magick.ppd
    and then you can write a script where in a line or two load a bitmap and draw stuff on it. It wont be very fast tho. You may find that wx does easy graphics. I know there is a wx opengl thing you can use so presumably that works under Python. I havent ever used it and tho GL is very fast its a bit of a chore loading and saving images with it.

  8. #18

    Default

    Unashamed bump! and progress update.

    YATG3D has not been forgotten but progress has been made very slowly. An understanding of the Beta version of the GUI interface has been sort of hammered out and a very nice chap is getting to grips with Python to write it. The initial software will still be pretty basic and I think I'll still be out there begging for someone to take it further after that. However, I'm hoping that a usable proof of principle Beta package might generate some interest? Ehem.
    It's currently being developed under Linux but will run under windoze - at least so far it does.

    On the povray Macro side I haven't done much except refine the fill tool a bit. Building macros is the easy bit.

    Observant viewers will notice that I used aspects of the POVray macros to create my New Amsterdam entry in the New york thing. This means I sort of have some other building types available to incorporate using those architectural styles but it's not really much to write home about.

    As a reminder, the protowebsite for this idea is still
    http://www.vgap4-info.org.uk/3DTownGen/
    but if you've been there last time I haven't changed anything on it since

    My Python man is not on board for the whole possible ride so if there is someone out there who just lurves to wrestle snakes then please get in contact.
    Needless to say again really but a really whizzo street node map generator would really ice the cake! I'm really hoping the dazzling Ravs will get his economic Andyland working!!

    More later, I hope!
    --
    "I do not know whether I was then a man dreaming I was a butterfly, or whether I am now a butterfly dreaming I am a man"

    My Finished Stuff
    ............. Some of my 3D Stuff (POVRay)

  9. #19

    Default

    That is smoking awesome. That is the kind of thing I want to do with my city. wicked wicked wicked.

    If I knew anything about the languages, i'd be in there like a dirty shirt. Whenever it's ready for beta i'll be a test dummy for sure. That way I can give you all the possible blunders a user can make LOL.

    Once again this looks fantastic.
    Last edited by danjr; 03-12-2011 at 03:46 AM.

  10. #20
    Guild Expert Ramah's Avatar
    Join Date
    Mar 2009
    Location
    Nottinghamshire
    Posts
    1,414
    Blog Entries
    4

    Default

    Glad to hear you are still working on this project, Crayons. I'd forgotten about it but just looking again at your early screenies renewed my enthusiasm for seeing what this baby will be able to do when you've got it more where you want it to be.
    Royal: I'm very sorry for your loss, your mother was a terribly attractive woman.


    My Cartographer's Guild maps: Finished Maps


    More maps viewable at my DeviantArt page: Ramah-Palmer DeviantArt

Page 2 of 4 FirstFirst 1234 LastLast

Posting Permissions

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