PDA

View Full Version : Mapping a curved road


Ritchie_77
09-08-2006, 07:11 AM
Hello guys. Once again a question about how to map a curved road. I've searched the forum for topics on this issue and found some, but still they didn't answer my question. So here we go.

I'm trying to texture a simple road of two lanes and a stripe in the middle. The road has quite a simple shape, it goes straight for a while, then it make a S-curve. So it bends to the right, then the same amout bach to the left again and after that it's just straight.

I've made a loft for the road using 1 rail sweep (NURBS) with several intersections and the centerline of the road as the path. I've also made a texture for the road with the same width as the road. Before I apply any UVW mapping the texture follows the shape of the road perfectly, it goes nice around the curves. Only problem is that it doesn't display the stripes as seperate objects but as one continuoes curve. Also the asphalt texture itself seems really blurred. After I apply an UVW map modifier to it (planar) the tiling is allright but it doesn't follow the shape anymore. It just seems as a regular pattern projected onto the road. All the other mapping types give no good result either.

My question is: isn't Max supposed to automatically tile and "bend" the texture according to the UVW coordinates of the underlaying surface? Then why doesn't it do it? Should I adjust the tiling of the road map? Should I use any UVW map at all?

I know Unwrap UVW will probably do the trick. Nevertheless I've textured a road before in Max, and from what I remember then the texture "automatically" sticked to the flow of the road.

Any help will be most appreciated!

soulburn3d
09-08-2006, 05:18 PM
Don't use a uvwmapping modifier, just use the uvs that the nurbs have provided. But I have no idea why you're not seeing the right result. Could you maybe post a picture. The nurbs uvs should work just fine.

- Neil

Ritchie_77
09-22-2006, 07:53 AM
http://i4.photobucket.com/albums/y120/Ries_77/testrender.jpg
Here's what happens when I use a UVW Planar map. Before applying the UVW map the road just turns black.

I wonder if I should remake the road because maybe the UV tiling is not correct. What's the best way to model a road?

Thanks for your reply!!!

K G B
09-22-2006, 09:45 AM
Maybe its just your position of the UVW mapping modifier in your stack that is causing the problem?
I just made a test scene with a simple plane with bend modifier applied to it. If i move the UVW mapping modifier above 'bend' the texture does the same thing you experienced, it goes in straight line. So here is a small image explaining all of this a little bit better I hope.

Also i found that that sometimes having a square UVW mapping regardless of the size and shape of the object helps the user get what he/she wants. you get more control over the pattern thus allowing you to get the desired effect quicker.

hope this helps

http://i106.photobucket.com/albums/m256/KGB_Section31/3ds%20max/curved-road.gif

Ritchie_77
09-22-2006, 11:11 AM
Thanx KGB...I will fizzle with that!

Can you show me a wire of the road? I'm very curious to the patches(? I mean the segments that build the geometry). I suppose those have an influence on the tiling as well?

K G B
09-23-2006, 01:00 AM
Can you show me a wire of the road?
Sure thing, here is the road, i mean it just has lots of segments in length, width segments are unnecesary for basic road surface although for more advancd road you might wanna place a few width segments as well, to simulate the curvature of the road (wight-wise).

http://i106.photobucket.com/albums/m256/KGB_Section31/3ds%20max/curved-road-2.gif

I suppose those have an influence on the tiling as well?
No,. the influence of the segments is purely to create a curve, more segments you have the smoother the curve looks. Segments have nothing to do with tiling. UVW modifier deals with tiling as well as Material editor.

http://i106.photobucket.com/albums/m256/KGB_Section31/3ds%20max/curved-road-3.gif


Usually when you are dealing with UVW mapping, you apply it to the object and then you click on 'fit' button. Then you fiddle with tiling in the material editor for every texture. I just found it easier, for things like road and other larger objects to fiddle with UVW mapping tiling. First you make the textures look ok, also having a square UVW map, so no 'fit' button in this case is very important. Then it makes no difference if I increase the size or length of the road (object), the textures stay the same - I mean they don't stretch to fit the new size of the object, the texture just ‘multiplies’. This way you can make universal textures, which you can apply to different projcts. You just copy the UVW mapping modifier to other objects or projects. and then you can modify their size.

http://i106.photobucket.com/albums/m256/KGB_Section31/3ds%20max/curved-road-4.gif

See in this example first object had its width increased, and I clicked on 'fit' button, so the texture strtched along with the object, therefore making the texture wrong size.

In the second example UVW mapping stayed square, so the texture size stayed exactly the same, it just 'multiplied'.

And the last one is just a normal one from before.

hope it helped.

Ritchie_77
09-25-2006, 09:52 PM
Thanx for your reply KGB, I really appreciate your help but unfortunately it doesn't work. I think the problem is you applied the map before you curved the road. In other words, the map just curves with the road. Exactly as you described.

I'm working in a different way. My road is a NURBS surface that has been built by using rails and profiles. It's very important that it follows these guides carefully in order to fit neatly into the landscape. I have posted an image of my road below:

http://i4.photobucket.com/albums/y120/Ries_77/roadtexture.jpg

You can also see the UVW mapping and material settings...

Ritchie_77
09-25-2006, 10:12 PM
With regards to soulburn's reply I sort of see what he means now...without the UVW map applied the road renders as follows:

http://i4.photobucket.com/albums/y120/Ries_77/road01.jpg

Here you can clearly see that the map follows the UV's of the Nurbs surface. You can also see that the road gets tiled more frequently in the corners. As you can tell form the wire, there are more segments in the corners. Is there a way I can rearrange the UV's of the NURBS surface so that the road tiles nicely. Or should I try UVW mapping???

K G B
09-26-2006, 02:02 AM
I see your problem, unfortunatelly i know more about sculpting than NURBS, and I know nothing about sculpting. ;)
But fear not, this forum is full of usefull people, someone will help you out.

I did find this tutorial, haven't read it all just glanced at it, but it looks like it might have some value to you. So here you are:

http://www.onnovanbraam.com/index.php?tutorials/mapchannels/

Ritchie_77
09-28-2006, 03:10 PM
Thanx KGB!


Come on you other gurus...HELP ME =)

PiXeL_MoNKeY
09-28-2006, 11:16 PM
Rithcie_77 you may want to check out the morphMap (http://users.skynet.be/arketip/arketip_morphMapENG.htm) script.

-Eric

tom1218
10-16-2006, 09:19 AM
hi,here,you can used LOFT in modifier list with the road ,that's very easy in your work

pipjor
10-25-2006, 11:02 AM
here's how you can solve your problem

K G B
10-26-2006, 02:01 AM
Ok, this is for anyone who has to map a shape which is not a loft.

http://www.cgarchitect.com/resources/tutorials/smoke3d/tutorial11.asp

Tutorial shows a few different aproaches to applying curved mapping to unusual shapes, and it specifically is good for paths and roads.

Just another method of achieving what you want.:thumbsup:

i tried it out, it works as it should, now only to find an easy way of creating those lines that seperate roadside curb into smaller segments so the curb doesn't look like it was in one frikin piece when rendered.

CGTalk Moderation
10-26-2006, 02:01 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.