Extracting the effect of material and light in spatial terms is computationally very heavy. This tutorial serves as an example as to how you can bake light calculations done by programs such as MentalRay or Vray into the surface of a 3d model. Once that is accomplished it is possible to use parametric applications to extract the baked information from the 3d model. The values extracted data can be used to analyze or manipulate the model.

This tutorial serves to help those trying to circumnavigate the limitations of Grasshoppers "Image Mapper". While grasshopper is able to extract color/lighting information from an image file, this appears to be limited to the horizontal plane at the moment. In other words you cannot map a image file onto a surface that is not in the cartesian plane. This post runs through a simple piece of add-on programming which allows you to achieve this. This post does not delve into the basics of grasshopper, image mapping or rendering out baked textures.

Download Tutorial Rhino + GH files:>>>>>[Download not found]<<<<<

[Download not found]

Required skills:

  • Good knowledge of 3D studio and texture baking in VRay or MentalRay. (if requested , I will add all of the baking and rendering to the tutorial) -  http://www.vray.com/vray_for_3ds_max/tutorials/basic_texture_baking_with_vray_part_1.shtml
  • Basic Rhino and Grasshopper knowledge.

Baking

Note: I have not included these steps in the tutorial, I can if someone requests it.

Once you have textured your model and setup the lighting you can render out the 3d surfaces to baked textures. Below are images from the baking process.

Baking out to texture

Resulting Baked Surface

Data Extraction

Once we have this map saved out as a JPEG we can import it back into Rhino using grasshopper. Image Mapper can be used for a surface in the cartesian XY, however in order to do the same on a vertical surface we need to employ some basic programming which is already included in the attached file as a VB component.

Basic Image Mapping

Custom non-cartesian Image Mapping

Each surface that makes up your model needs to be setup individually within the parametric framework (grasshopper). Above you can see two separate parts of the definition. The first is the standard Image Mapper, used for the floor. The wall however needs to use the custom VB component, it requires that you specify the directory path that leads to the image on your hard drive. It will calculate a color for each pixel in your image.

DO NOT USE LARGE IMAGES!! an image of only 108 x 150 pixels results in 16200 colors. Your computer will hang or crash if you use large images.

Parametrics

Now that you have a list of RGB values, you can utilize grasshoppers built in color components to extract the individual Red, Green, Blue values from the list of colors. These values can be converted into floating point values and then used to manipulate the points on the surface and hence the surface itself.

The wall is manipulated by only shifting the most intense red portions of the light that fell on the surface in the X direction.


logo-default-ss_c

Synthetic Spaces is the design portfolio and writings of Carson and Anja Smuts.

Copyright 2018 SyntheticSpaces © All Rights Reserved