Grasshopper

algorithmic modeling for Rhino

Hi guys,

I am trying to generate an image (i.e. displacement map or a heightfield) from an existing 3D mesh.

Most of the tutorials I have seen teach the reverse of what I am looking for -- "How to generate a mesh from an image". The reason I would like to generate the heightfield from an existing mesh topology is because I need to import it into Unreal Engine 4 to use as an optimized terrain / landscape. Unfortunately, generating a heightmap seems to be the only way to solve this problem.

Are there are any tools available that could output a displacement map as an image? Or would I be better off using WB and other mesh tools to color my mesh according to each face's z-coordinate values?

Views: 1177

Replies to This Discussion

The problem with heightfields is that it's difficult to make them at all accurate. If you use the grey-scale value, then you only get 256 levels of elevation which is crap for any decent landscape.

It is true that you cannot make images with vanilla Grasshopper, but it's not difficult because the hardest bit has been done (mesh ray intersections).

I attached a file which generates (and saves) an image from a list of colours and a width (the total number of colours provided has to be an exact multiple of the width). You just need to provide the colours you need, which you can generate by using Mesh-Ray intersections and mapping the intersection point z values onto the correct gradient.

Attachments:

Thanks, David! This is a great start.

I am not familiar with Mesh | Ray intersections. However, I assume that once I have the intersection points, I should Deconstruct them, extract the Z-Coordinate, and feed that into the Bounds component using the definition that you provided... Did I understand that correctly? Here's a screenshot of what I'm describing: 

Everything in your description is clear. What I am confused about, however, are the general mechanics of the Mesh | Ray Intersection component. Do I need to create a line that spans the distance from the bottom of the mesh to the top of the mesh from which I shoot rays? If there is a precedent example that could be provided, that alone may clear up my confusion.

Any help is greatly appreciated.

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service