How to create a mesh of the city bottom surface?

594
6
03-07-2018 02:50 PM
TonyGodfrey
New Contributor

I need to create a mesh that is equivalent to the bottom of the entire city mesh.  For example, if the entire city was on a completely flat terrain, this mesh would be all of the sidewalks, streets, and lots flattened, and then the normals reversed.  so the mesh would not be completely flat because the sidewalks are a bit above the streets and lots.  Basically it is a bottom surface for the city that will be used to precisely set the terrain height in Unity.

Any suggestions on where I should start digging?

Thanks,

Tony

0 Kudos
6 Replies
LR
by
Occasional Contributor III

Have you tried the "align terrain to shapes" option?

0 Kudos
TonyGodfrey
New Contributor

Thank you for the response.  I have, and I am still experimenting with it, but let me explain why I think it isn't the best solution for me right now.  I am working with a 10 sq km terrain.   I am experimenting with using the entire full resolution 9938x9938 heightmap and also trying to find a good way of just using a small part of the heightmap where the city will be generated.  I am guessing I will need to use the full resolution heightmap for the most accurate representation after CityEngine has aligned the terrain to the city.

The CityEngine models will only be used in a couple of different places on that terrain.  The terrain is prodedurally generated in Unity3D and uses RayCasts pointing vertically upwards to shape the terrain when the raycasts collide with an appropriate collider. If I can build a mesh that is equivalent to the bottom of the city and put the collider on it, the procedural terrain generator will be able to shape the terrain under and immediately surrounding the city just as I want.  This makes it simple for me to move the city around anywhere on the terrain and the generator will just match things up.

Anyway, I am working my way through the tutorials and I am pretty sure it's possible to do what I want, but I'm just not proficient enough with CGA yet to do it.

0 Kudos
DevinLavigne
Occasional Contributor III

I'm not quite following - Do you have a picture or image of something like what you are looking to do?

0 Kudos
TonyGodfrey
New Contributor

Here is a video that might give a better idea: https://youtu.be/6Syf3CCplS8

0 Kudos
LR
by
Occasional Contributor III

Depending on your models you could also just s('1,0,'1) at the end to flatten them.

0 Kudos
TonyGodfrey
New Contributor

Hmm, maybe I could just export flat lots/streets as a separate model and then invert the normals on that.  I will give it a shot.

0 Kudos