Tuesday, January 23, 2007

Drawing Intersections - Part 2


Wow, that was fast for a change. I was able to add just a few lines of code to start getting the intersection's grayscale maps going. I cheated a bit as I coded the road to be level until I can update the road averaging code (what keeps the road moving up and down with the terrain). And as the image shows, there's a "monument" in the middle of the intersection which comes from no drawing routine for that small part. And the cut and fill misses a quadrant of the intersection. And I still have to add code to the road texture subroutines. Other than that, I'm pleased I got something I could render in Bryce after 15 minutes rather than the usual multiple days of tracking down problems.

Monday, January 22, 2007

Drawing Intersections - Part 1



To draw a road, Road Maker has to determine how to draw the center of the road, the edges, the cut and fill, and the various road lines. Adding an intersection makes it even more complex as everything has to fit together. It would be easy for me to stick to a single road but allowing intersections will provide more options for the artist.

The roads in Road Maker are drawn twice - once in outline form in the Draw Road window and then once in grayscale form in the Image with Road window. This is done to speed up design, as the grayscale roads are slower to create than the outline version. I've mostly finished up the first part, which draws the intersection in the Draw window. The even harder part, the grayscale intersection, is yet to come.

It took longer than I expected to adjust the code (it always does!) but I mostly have it working. There's still a particular road size which cause lines to be drawn to the upper left corner but I should be able to track that down. Mostly I had to modify existing code to add in exceptions (if this is true, then do this, else do this other thing). I've tried to craft the code so it's flexible for the future. For example, the basic road outline code will also be able to do curbing, fencing, telephone poles, guardrails, etc.

Here's an image of the outline drawing of the intersection. Doesn't look like much now but hopefully I'll be able to show a grayscale version soon.

Tuesday, January 16, 2007

Progress on Intersections

I've been bedeviled for some time by some math that I finally figured out today. What I solved was the fact the when you move an intersection, the roads have to follow. If the road has more than 2 dots, the road didn't point to the center of the intersection (and a crash off the side of a cliff was sure to follow!). I finally tracked down the math problem and now it seems to work.

To add an intersection, your create a second road that overlaps the first. You then point with the mouse at the point of intersection and type the letter I. That splits the two roads into four and then opens them up for the intersection to fit in. You can then move the intersection and the road follows. Obviously this isn't complete - next I need to write the code that draws the intersection that fits into the gap.

Monday, January 15, 2007

Multiple Roads

The current version of Road Maker allows you to have one road - straight or curvy. It can loop back on itself, but that's not recommended (yet) as you will get odd results.

I have put in a lot of code to allow multiple roads (up to 20). It is mostly working except for the undo/redo function which still has some bugs to work out.

The biggest reason for multiple roads is to allow intersections. A lot of this code is written but much remains to be done. This is my major focus for the near term.

Rich

Images

Images showing progress to date have been posted at 3D Commune's Bryce Forum (http://www.3dcommune.com/3d/forum.mv?Bryce) or Bryce Gallery (http://www.3dcommune.com/3d/gallery.mv?Bryce+only+6+NUTnc7RR6). Bug fixes and new features are updated periodically.

Road Maker

This blog describes the on-going development of a new 3D prgram called Shape Magic Road Maker. This program can carve virtual roads into grayscale terrain maps for use in 3D programs like Bryce and Vue. The road will rise and fall with the terrain, with cut and fill just like a real road. After the grayscale map is modified, it can be saved and imported into your 3D program. Road Maker also creates road texture and alpha maps that can be used in 3D programs to provide a road texture that is different from the rest of the terrain.

The current version can be downloaded from http://www.shapemagic.com/roadmaker/

Road Maker is sponsored by Shape Magic - an easy to use 3D model maker.
Free demo available.