POV-Ray is an extremely powerful and (amazingly enough) free ray-tracing application that runs on many platforms. It generates very high-quality output and supports advanced features like transparency, refraction, non-uniform fog, atmosphere effects, and much more. Most POV-Ray users generate their scenes by writing code directly in POV-Ray's scene description language, which works well for relatively simple shapes like boxes, ellipses, and planes. But for more complex shapes, a 3D modeling program is indispensable.
That's where Meshwork comes in. Meshwork allows you to build complex shapes graphically, with a simple blueprint-like interface and a 3D preview that allows you to see your model from any angle as you work on it. Once satisfied with the model, you can export it to a POV-Ray file, include it in your POV-Ray scene, and generate a high-quality rendering.
Then, choose Export > POV-Ray. The result is a POV-Ray include file -- just a text file containing POV-Ray code. My example was exported to a file called rose.inc.
pigment { image_map {png "texture2.png" map_type 1}When Meshwork exports to POV-Ray, it doesn't know how you'll want to name your texture files. So it uses a simple pattern: the first material (colored white by default) is called "texture0.png". The next one is called "texture1.png" and so on. In other words, Meshwork assumes you have texture files, stored in PNG format, with numbers that correspond to the Meshwork material used.
To finish the POV-Ray model, you have two choices:
(In a future version of Meshwork, you'll be able to specify "material names" to be used as texture names in the POV-Ray export, making this step unnecessary.)
For this example, I chose to take the second approach. I changed the line of code above so that it now reads
pigment { image_map {png "texture-green.png" map_type 1}...and I made sure that, in the same folder as the include file, I had texture-green.png ready. (The Mac version of POV-Ray can read PICT files, but PNG is more standard in the POV community, so I used GraphicConverter to save my textures in that format. This way, the whole model could be zipped up and sent to someone using POV on some other platform if desired.) I then found the next occurrance of the work "texture", and made it refer to "texture-red.png".
Save the include file after making any changes, and launch POV-Ray.
There are several things worth noting in this file. First, the include file is loaded and made into an object as follows:
#declare Rose = union { #include "Rose.inc" }The "union" is needed if you're using Meshwork 1.4.1 or earlier; as of Meshwork 1.5, it can be omitted. Second, Meshwork models tend to be hundreds of units tall, whereas the standard POV objects are about 1 unit high. So you'll probably want to scale your object down by a factor of 0.01 or so.
First, check your rendering preferences (command-Y in POV-Ray). This is where you set the output dimensions, rendering quality, output format, and so on.
After setting up the scene and the rendering preferences, hit command-R in POV-Ray to render. My example came out like this:
The textures are subtle, but they are clearly there; they give the image a realism that could not be obtained with solid color.
There is still a lot that could be done to improve this image in terms of composition, background, and so on. But as a demonstration of using a Meshwork model in POV-Ray, our rose has done its job beautifully.
If you have any difficulties, write to me or the Meshwork Discussion List.