openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.93k stars 2.55k forks source link

ofCairoRenderer ofMesh doesn't render properly to PDF #1145

Open rezaali opened 12 years ago

rezaali commented 12 years ago

When attempting to render a mesh to a PDF the ofCairoRender does not output a filled mesh, thus the PDF output looks empty.

If you open the file in illustrator you'll see the paths, there but with no stroke or fill.

When I dug into the issue a bit further I realized that Cairo isn't capable of rendering shapes with per vertex colors easily...

rezaali commented 12 years ago

this might provide some insight on how to accomplish this...

http://kapo-cpp.blogspot.com/2008/01/gradients-in-cairo.html

the only problem is that when you draw a mesh its usually a series of triangles, and not a rect like in the example above.

elliotwoods commented 12 years ago

out of interest, would the priority to be either:

  1. Draw per vertex color
  2. Draw texels
  3. Draw per vertex lighting
  4. All of the above? (e.g. detect if texture is bound, detect if lighting is on, detect if vertex colors exist)
rezaali commented 12 years ago

Hi Elliot!

Right now, the priority would be draw per vertex color.

joaodafonseca commented 9 years ago

Any update on this issue? or a workaround to save colors from a ofMesh to a pdf?