Jump to content

OSM road data vs curves... a question.


three5

Recommended Posts

OK so let me set this up:

My goal here is to use the Mapbox sop to bring in height data and then project some of the road data onto the heightfield so the roads can rise or cut through the heightfield, just like an real highway would.

I was able to get this to work with a bit of Vex + curves on Mapbox heightfields, but if I use the OSM data to project the roads, it doesn't work.

I tried a sweep + extrude on the OSM, and that sort of works but it doesn't look quite as good and tends to float over the heightfield rather than conform to it.

Some background on me: I'm pretty new to Houdini, still figuring some things out. I tried taking the points from the road I wanted to project and using an add sop to make a curve, but that didn't seem to do the trick.

I'm guessing that the OSM data is a different kind than the curve. What I'm interested in more than just having someone explain how to convert the OSM road to the right format, I'm curious how I can tell the difference in one kind of curve from another. The geo spreadsheet wasn't much help to me in this case. 

I've attached a hip file, there's a switch between the OSM data and the curve, and they have very different paths so I can easily tell one from the other in testing.

curve_plus_heightmap.png

OSM_plus_heightmap.png

maptest.hiplc

Link to comment
Share on other sites

OK I was digging a little deeper: It isn't the OSM data, it is something that the Mapbox sop does *to* the OSM data.

If I load the OSM data that Mapbox saves and then run it through my chain, it works. But, it isn't oriented or cropped properly. 

I'm going to take apart this Mapbox sop a little more and see if I can come up with where it breaks.

Link to comment
Share on other sites

OK there's an attribute wrangle in the Mapbox sop that preps the OSM data and crops / aligns things, and it looks like I found a bit of a bug.

 

There's an if statement at the end:
 

if (chi("snapterrain") == 0)
   v@P.y = Ypos;

When I add the brackets that should probably be there, and swap the 0 for 1, the Snap to Terrain checkbox on the seems to work on the Mapbox parameters and it doesn't break the OSM data anymore.

 

if (chi("snapterrain") == 1){
   v@P.y = Ypos;
   }

 

I suppose if any of the Labs team(who are super rad!) reads these threads, it might be worth looking into.
   

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...