Recently I've been looking at Povray, pyprocessing, and cfdg (version 3.0) as tools for creating digital images. I have branched two separate blogs where I mainly explore jruby + processing and processing.py

Sunday, 29 January 2012

How to export from processing to povray

When using toxiclibs libraries:-

If you are up for a bit of hacking you could recompile toxiclibscore.jar to include my POVWriter.java and a modified TriangleMesh.java library classes code available as a gist https://gist.github.com/1639360. Depends on creation of mesh. Revised 29 February 2012 download my povmesh library here.

When using hemesh libraries:-

If you are up for a bit of hacking you could recompile hemesh.jar to include my HET_POVWriter.java a modified HET_Export.java library classes code available as a gist https://gist.github.com/1658952. Depends on creation of mesh.  Latest version of hemesh 1.7 beta now includes POVWriter functionality.
update 21 Feb 2012

In both these cases the geometry is exported as 1 or more "declared" mesh2 objects in a povray inc, so a pov file needs to be created to include and use the mesh2 objects and to set the scene (camera, background etc) and to add texture. It doesn't harm to create an ini file to call the pov file (the ini file can be used to set the quality etc). It may be necessary to scale/and or translate the mesh2 objects in the pov file. Otherwise upto and including processing-1.5.1 use my custom povwriter library (most 3d sketches, captures color information) get the povwriter library here http://java.net/projects/povwriter/pages/Home or since processing-2.0a6 https://github.com/monkstone/povwriter2/wiki.

What to expect, rendering using my povwriter library use a union of triangles, usefully lines/stroke can be output as a blob (a cylinder with a sphere at either end. You see triangle facets. The library is designed to allow for ray-tracing direct from the processing ide, currently both geometry and scene description are output to a pov file (with camera adjusted to aspect ratio using a declared variable in the ini file), the quality settings (accessible in the processing ide as enum constant) are output to an ini file.

Using my modified hemesh and toxiclibs library the mesh is exported in povray mesh2 format, and the default is include normals, hence output is rendered as a smooth surface, but ther is the option to not include the normals and facets are visible.

Here's my latest experiment exploring toxis implicit mesh function.

No comments:

Post a Comment

Followers

Blog Archive

About Me

My photo
Pembrokeshire, United Kingdom
I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2