Working on the Railroad

TerritanTerritan Posts: 76
edited December 1969 in Carrara Discussion

The scene I'm trying to build is a still of a train (bullet-style) on (or over) a track running across a terrain under a realistic sky. In the background or along the track, well, that's where I'd put my "product placement."

The train itself is easy enough to model, especially when it's streamlined. And the terrain isn't so bad, and with a little fine-tuning, the realistic sky looks fine. No, the challenge that I face is the track. Is there a way to make it follow the terrain reliably?

I'm working in the Large scale right now so I can get enough scenery in the shot to establish it. And this makes it hard to work on details, like getting the track to follow the terrain. Were I to switch to Medium, I'd lose a lot of that luscious background, and I'd have to stretch the working box way out if I wanted to render more than one or two train cars.

Suggestions?

Comments

  • DiomedeDiomede Posts: 15,158
    edited December 1969

    You might try this tutorial by Mark Bremmer. Roads are not tracks, but it may be a good start. There is an example of its use by Dudu in this month's Carrara challenge.

    http://www.markbremmer.com/3Bpages/darkarts.html

    Described by the Mark as

    "This tutorial is definitely not for beginners and is not about painting in the Carrara terrain editor. 35 minutes of wizarding with Carrara and other software show you how to create textured roads that quickly follow your terrain features while also remaining smooth and graded. The smart observer will also figure out how you can build mountain switchback roads and roads that span valleys just waiting for you to connect them with modeled bridges. Too much fun."

  • DartanbeckDartanbeck Posts: 21,525
    edited December 1969

    There's that, and in addition to, or instead of, you might want to just make your tracks flat in sections that have supports from the ground, holding it up above an otherwise unnavigable terrain. Make the supports long enough to never ride above the terrain, then you can just use the duplicate command to make further sections, and apply a slight bend modifier where you need to make corners.

    I do believe that you'll have an easier time navigating the model process in a Medium scene scale, but that's just me.

    Food for thought, perhaps?

  • DartanbeckDartanbeck Posts: 21,525
    edited December 1969

    Further, the bend modifier has falloff sliders for both ends, so you would have decent control over where the bends are made. Just keep 'x' number of duplicates in a group, and apply the modifier to the group. I think that would work anyways. Then always keep a group of straight track duplicates handy so you always have a plain one to start from.

    But if the whole thing could take a single bend modifier, I wonder if that could be used on the train as well, if it were included in the group. I believe so.

  • d-j-od-j-o Posts: 345
    edited December 1969

    If it's a project, cheat, render your faraway and background stuff. Then render the closer stuff in the same lighting with alpha, then in Photoshop place together, have the closer stuff block non existing far away tracks, through camera positions,

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    Territan said:

    I'm working in the Large scale right now so I can get enough scenery in the shot to establish it. And this makes it hard to work on details, like getting the track to follow the terrain. Were I to switch to Medium, I'd lose a lot of that luscious background, and I'd have to stretch the working box way out if I wanted to render more than one or two train cars.

    Suggestions?

    No you wouldn't lose the detail. You can stick large terrains in a medium scale terrain with no issues.

    You can also switch scene magnitude on the fly, and the working grid will still stay the same scale as it was when the scene was started. Switching the scene magnitude from large to medium will not effect anything except camera movement, and maybe the scale of the avatars for lights and cameras inserted into the scene after the magnitude was changed. The avatars for the lights and cameras inserted into the scene prior to a change in magnitude retain their scale, just like the working grid.

    The switch the scene magnitude, select Scene in the Instances Palette, and then at the top of the screen, select Interface. Once you've selected the Magnitude, you just click apply.

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    There's that, and in addition to, or instead of, you might want to just make your tracks flat in sections that have supports from the ground, holding it up above an otherwise unnavigable terrain. Make the supports long enough to never ride above the terrain, then you can just use the duplicate command to make further sections, and apply a slight bend modifier where you need to make corners.

    I do believe that you'll have an easier time navigating the model process in a Medium scene scale, but that's just me.

    Food for thought, perhaps?

    Great point Dart. In real life, railroads have long steady up-grades and down-grades. Also long, gradual curves. More so for the high speed rails and passenger lines. There are some exceptions to the curves in the mountains, but they are still not what you would call hairpin, as there are physical limitations that the haulage imposes.

    Narrow gauge, spurs designed to bring out specialized cargo, such as ore cars from mines and lumber cars from remote cuttings are an exception, but you won't see passenger or large freight on those.

  • That Other PersonaThat Other Persona Posts: 381
    edited December 1969

    You might Google images of the bullet train (Shinkansen) in Japan.

    It is very often on a raised platform over terrain and city structures.

  • pwiecekpwiecek Posts: 1,576
    edited March 2014

    This looks like a good place to request that someone apply easy pose to the problem. I'm thinking that 2 separate models, the rail and the ties. If I could model, I'd do it myself. In fact, this seems like an easy project for a beginner. I understand that DS has a way to do this with a properly rigged structure.

    Bear in mind that trains make long sweeping curves, not sharp turns. And gentle gradients.

    As an alternative, I came up with a way to use stitch witch to lay out a 2D railroad texture

    LATER

    Quick and dirty. Easy Pose Tube (by Ajax) with a wooden bar parented to every 4th node

    RR_Ties_5.jpg
    600 x 600 - 101K
    Post edited by pwiecek on
  • RoygeeRoygee Posts: 2,247
    edited December 1969

    i just happen to be experimenting with this very same concept - in another thread, been getting some advice on using RaodMaker to carve out roads in a terrain.

    At this point, it is very rough - was testing out a concept to see whether it was worth pursuing.

    I used Hexagon because that is my comfort zone and Carrara doesn't have some of the tools I needed, but I'm sure if I give a brief description, someone will explain how to do this in Carrara :)

    Once you've made the roadbed - either using RoadMaker or a 2D paint app to modify the terrain heightmap, make a copy of the terrain and convert to mesh.

    I imported as .obj into Hex, extracted a curve along the length of the cutting, duplicated and and offset it. Gave the two offset lines thickness - for close-ups I would make a proper shape of the track and sweep it. Made a sleeper from an elongated cube and copied it on a support using the duplicated curve.

    Deleted the terrain and imported the railway track.

    It is really rough, but it showed it was worth taking the trouble to do it correctly :)

    railway_overhead.jpg
    640 x 480 - 57K
    railway_view.jpg
    640 x 480 - 40K
  • DiomedeDiomede Posts: 15,158
    edited March 2014

    Usual caveat that there is usually more than one way to tackle a 3D project. Here is one way that I think would work.
    If you have been following other threads, you know that I am not getting on well with carrara's terrain editor right now, so I'm not saying I can do this myself. However, I think I can describe one way to do this in carrara and Photoshop (or image editor of your choice).

    1) Export your terrain heightmap from carrara at a higher resolution than the default.
    2) Import your terrain in Photoshop (or anything with layers)
    3) Use layers and blur to create the path of your railroad road bed. Make it wider than you need for the just the tracks. Try to follow the grade and slope suggestions made by others in the thread. Save under a new name - "terrain and roadbed" or whatever.
    4) Create a shading zone for the roadbed. Save as new filename - "roadbed shader distribution" or whatever. Color the roadbed white and the rest of the terrain black. When you go back to Carrara, if you want, you can assign an appropriate shader to the roadbed distinguished from the rest of the terrain.
    5) Starting with "terrain and roadbed" from (3) create heightmaps for the tracks. Add another new layer. Draw two parallel white lines (or however many rails you want) along the blurred roadbed. Then use an add function (perhaps several times) so that the rails are brighter than the roadbed. Save the file under a new name "heightmap adjusted" or whatever
    5a) Save the new heightmap under another name - "terrain with roadbed and rails" or whatever.
    5b) Save the new heightmap under yet another new name - "rails shader distribution" or whatever. Paint the rails white and the rest of the terrain and roadbed black.
    - you should now have what you need so it is a matter of applying the heightmaps and shader masks in Carrara
    6) Import the heightmap from 5(a) "terrain with roadbed and rails" into the terrain editor. You should have a terrain that has a train roadbed running through it. The roadbed should have two (or however many) rails rising up from it.
    7) Use the distribution map from (4) in a shader layer mask channel to control the shader for the roadbed.
    8) Use the distribution map from 5(b) in a shader layer mask channel to control the shader for the rails.

    Post edited by Diomede on
  • RoygeeRoygee Posts: 2,247
    edited December 1969

    Finally got my method to work:)

    The challenge was to get a smooth curve off the surface of the terrain - couldn't do that after converting the terrain to .obj, so made the terrain in Bryce, which interprets heightmaps more accurately than C. Exported as .obj and used a feature in the VM which is superior to Hexagon - the ability to draw a curve along a surface.

    To get the curve into Hex, I swept a circle path and extracted the curve from that in Hex. Everything followed from that.

    So glad to get it sorted that I ended up making an anim - haven't done that in ages, but with my new 64bit machine zipping along with four cores, it is once again a lot of fun!

    The video is at http://youtu.be/k7GlIoJMZ1Q

    railway3002.png
    640 x 480 - 223K
  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    That's great Roygee! I really do have to fire up Hex at some point and explore its tools a bit.

  • That Other PersonaThat Other Persona Posts: 381
    edited December 1969

    Very nice Roygee.

    BTW, did you do the smoke in Carrara? If so, how?

  • DiomedeDiomede Posts: 15,158
    edited December 1969

    @Roygee - that is beautiful, my friend. Great job. You know, if you had a car racing that train to crossing, it could be in this month's challenge. It is my duty to point that out this month. :cheese:

    After what Roygee showed, I probably shouldn't even bother with this. However, just to show that in principle much can be done entirely in photoshop (or image editor of your choice). The following was done with no modeling. I only used the layers, selection, blur, and color hue functions of photoshop as per my post above. This image has 1 rail, but If you create a custom brush with 2 circles, you could create two rails. In Carrara, the shader is the complex layers function, using the images exported from Photoshop to control the mask to put stones on the roadbed and to apply a brighter color to the rail.

    Cheesy, but it demonstrates that some progress could be made without vertex modeling.

    post_for_train.jpg
    640 x 480 - 30K
  • RoygeeRoygee Posts: 2,247
    edited March 2014

    Thank you, Diomede :)

    Couple of things I found with all this messing about with Roadmaker is, firstly, that Bryce does a far better job of interpreting heightmaps, thereby getting cleaner results. Secondly, that it is better to use .tif because of the smoother steps it gives with greyscale. I' m no expert at this - got it over at the Bryce forum from Horo that BMP gives 256 steps while TIFF gives 65,536 steps.

    If you have Bryce, try using the same map there, after converting to .tif.

    Way back when folk used Carrara for more than rendering e-dolls, we saw some interesting modelling done using heigthmaps :)

    @ That Other persona - yes, the smoke was done in Carrara - it is a simple spite, with some alpha. After all the messing about Ive done with smoke, I really can't recall whether this is something I made entirely by myself, or got it from another user - being this simple, I suspect it was one of mine:)

    Here's the sprite - put it on a camera-facing particle with 23% alpha, then mess about with settings. For the life of me, and I've followed many tuts, I can't get it to fade to grey - have seen somewhere that this is a problem with C8.1, but maybe I'm just thick:

    smokesprite.png
    256 x 256 - 26K
    Post edited by Roygee on
  • That Other PersonaThat Other Persona Posts: 381
    edited December 1969

    Cool.

    I am still fairly new to all of this and have never worked with sprites. Maybe a project for the weekend!

  • DiomedeDiomede Posts: 15,158
    edited December 1969

    Roygee's train scene speaks for itself. It is obvious that using Bryce and Hex does a magnificent job of creating a railroad through a terrain.

    RE: Carrara. Roygee asked me to use a tif file format and then use Bryce and Carrara. Actually, Carrara performed better in my opinion, once I adjusted the resolution settings in the terrain modeling room. Please note that I am willing to bet mega-bucks that the result is entirely due to my unfamiliarity with Bryce. I have attached a pic comparing the same photoshop heightmap brought into Carrara by first going through Bryce and exporting as an obj (left) and importing the heightmap directly in Carrara (right). To my eye, Carrara's direct import has more detail because I increased the resolution (see second pic). Now, I did a test of converting the Carrara terrain to obj (to be consistent with the bryce terrain on the left) and the Carrara terrain had over 2 million polygons. So, I am almost positive that the resolution could have been adjusted in Bryce to be superior to Carrara.

    RE: Cheesiness. The cheesiness of my previous post is due to my lack of skill in Photoshop and my choice of using a relatively low resolution terrain model, not an inherent feature of Carrara. I was just trying to illustrate that rails could be created on a smooothed roadbed entirely through the image editor's heightmap. The more skill you have with an image editor, the better job you could do in creating a heightmap with train tracks across a smooth roadbed.

    RE: modeling and sweep paths. I think what I am about to say only applies to people with the pro version. In Carrara, like Hex (but not as good), you can define a shape and a polyline sweeppath to extrude modeled train tracks along the roadbed. Because you can vertex model in the assembly room, you can create the polyline along the smoothed roadbed. (See third pic). For the sake of this post, i am including a pic of such a sweep path, but I'll try to find time this weekend to actually create such a railroad track on a terrain. .

    None of this is to imply that Carrara pro can be as effective as Bryce or Hex - Roygee has demonstrated that with finality. It is just to show people who are familiar with Carrara's tools (but not other programs) what they might be able to do.

    settings_terrain_editor_compare_to_Bryce.jpg
    712 x 413 - 149K
    polyline.JPG
    616 x 411 - 20K
    compare_2_bryce_export_and_carrara_direct_import.jpg
    640 x 480 - 169K
  • RoygeeRoygee Posts: 2,247
    edited December 1969

    Yes, resolution is what it is all about - in Bryce, when you export an object there is a slider that lets you select the poly count to some insane numbers. Mine is 54K.

    I found that in C, at 2056, the cutting was a shallow valley with lumpiness on the floor. The Bryce import had well-defined cuttings and an absolutely flat road surface.

    Yes, this is very do-able using only Carrara - just for me using all three was more convenient.

    Did you find that .tif gave better results than other formats?

  • DiomedeDiomede Posts: 15,158
    edited March 2014

    Roygee said:

    I found that in C, at 2056, the cutting was a shallow valley with lumpiness on the floor. The Bryce import had well-defined cuttings and an absolutely flat road surface.

    I did a couple more tests, and they confirm your point. I used a .tif file exported from PS. There seems to be a tradeoff in C8.5. At a higher resolution, I can get defined cuttings and raised roadbeds, but the path will not be smooth. The path is terraced, as is the terrain mesh more generally. On the other hand, at a lower resolution, I get a smoother path, but the terrain loses a lot of its detail. I wonder if that could be partially addressed in the bump channel. I tried keeping the higher resolution, but using a smooth filter in the terrain editor, but the results were not all that different from just using lower resolution settings in the terrain editor.

    You should be able to see the tradeoff of a terraced path vs less detailed terrain in the attached pics. (Edit - note, the pics just use the default terrain shader and the default lighting)

    high_resolution_smooth_filter.jpg
    640 x 480 - 33K
    higher_resolution_stepped_roadbed.jpg
    640 x 480 - 42K
    Post edited by Diomede on
  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    I seem to recall that there was a way around that, but it ecapes me. When I remember or figure it out, I'll post it.

  • DiomedeDiomede Posts: 15,158
    edited December 1969

    Roygee said:

    Did you find that .tif gave better results than other formats?

    Within C8.5, I can't tell the difference between tif and jpeg. In the attached, I have two terrains side by side (overlapping). The path on the left is from importing the heightmap in tif format. The path on the right is from importing the heightmep in jpeg format. Otherwise, the terrain settings and shaders are the same. The path on the right is partially obscured by the left terrain. My eye can't tell the difference between the terrains or paths, but whatever is causing C8.5 to be less accurate than Bryce might also be preventing Carrara to take advantage of the extra detail available in the tif format.

    @EP - if you can remember a solution, that would be great.

    I think I am following the same basic methods that Mark Bremmer and PhilW use in their tutorials, at least for the Photoshop portion, but I will have to go back and rewatch them. I can only think of 2 differences. First, I smooth a path within a path so that I have a wider roadbed (shoulders) and a narrower road. Second, I use the "enhance" / "hue" function in Photoshop to raise or lower the roadbed above the shoulder. But I've gotten similar results when I don't use the hue enhancement, so I don't think that is it.

    left_tif_tight_jpeg.jpg
    640 x 480 - 44K
  • DUDUDUDU Posts: 1,945
    edited December 1969

    I believe that the .tif format is much more precise than the format .jpeg, which can create some artefacts.
    You should not hesitate to soften the edge of the calk and also to play over their transparency.

  • DiomedeDiomede Posts: 15,158
    edited December 1969

    I spent most of the day trying to rehook various devices to the internet after my service provider decided to change my wifi name and password. But, I did set aside a few minutes to try to extend RR tracks along the road bed.

    First, In the vertex modeler, I used a simple grid to make a cutaway of a RR track (box with two small boxes rising above). Then I went into the vertex modeler, using the top camera, and brought in the road path that I used in Photoshop to carve out the roadbed (black and white image) onto the background of the drawing plane.

    With the RR cutaway at one edge of the path, I used the curve polyline tool to follow the path. I then used the sweep function to extend the RR cutaway along the path.

    I then went into the assembly room, and used the model in the assembly room feature, to resize and raise the RR to the roadbed.

    I'm not going to try to make it look nice, but I had said I would try it this weekend and I'm running out of time.

    roadbed_adjusted.JPG
    650 x 385 - 46K
    railroad_sweep.JPG
    564 x 458 - 40K
    polyline_curve_sweep_path.JPG
    577 x 524 - 39K
  • DartanbeckDartanbeck Posts: 21,525
    edited December 1969

    Wow. What a cool idea!

  • DUDUDUDU Posts: 1,945
    edited December 1969

    Is this a rail road or the great wall of China?
    Nice job !

  • DiomedeDiomede Posts: 15,158
    edited December 1969

    Is this a rail road or the great wall of China?
    Nice job !

    Great wall of China? Yes, well done. I was actually experimenting with ways to make a wall through a terrain when this railroad thread was started. I was considering doing a wall (maybe the Roman walls in Scotland) for the fence challenge, but changed my mind. Someone could use this same method to make a RR track, or a wall, or a fence, or anything else that stretches across an undulating terrain or to span bridges. The more practiced a person is with the polyline tool, the easier and better this would be. Unfortunately, I've only just started experimenting with the polyline tool, but I can see a lot of potential.

Sign In or Register to comment.