ok, so cairo rendering seems to disregard 3d completely.
However there is in ofBeginsSaveScreenAsPDF a b3d bool parameter which was giving me some hope
actually by looking at the implementation of ofCairoGraphics it seems to be implemented, but I’m not quite sure how to test beyond setting it to true on ofBeginSaveScreenAsPDF. Also in this old pull request by arturo
there is a dead link to a pdf rendering of the 3d squirrel so in principle it should be possible to have 3d correctly interpreted by cairo, but I can’t find the way.
Is there a more advanced example of cairo rendering available? maybe using it directly?
the 3d capabilities of the cairo renderer are very limited and at the time it doesn’t support cameras. the problem is ofCamera is currently using openGL directly instead of OF calls so the cairo renderer want get affected by the camera matrix. i want to solve this at some point by having an OF function to upload a matrix to whatever renderer you are using and make the cameras use those but it’s not there yet
Hey there Jesus,
the trick when it comes to saving 3d vector graphics in cairo etc. is to unproject the 3d unto 2d.
You simply need to iterate through the 3d paths when you are saving out and draw with
Never thanked you for this. I’ve been using it and It works beautifully. Thanks a lot!
May I ask an additional question? With that trick I can get the position of the object but I still need the size at which it should be rendered on the pdf. Do you know how I can calculate that size? I guess it has to do with the fov of the camera, but I’m my 3d math is hazy and I haven’t been able to find the solution.
Any pointers greatly appreciated.
Thanks again,
jesus