|
|
I try to use POV-Ray in C. I have two versions of POV-Ray 3.7 and 3.7 installed
via the Ubuntu official repository and from the source, respectively.
However, I am unable to find the corresponding C header (povray.h) anywhere to
compile the script.
I have a simple script of
#include "povray/povray.h"
int main(int argc, char *argv[])
{
// Initialize the POV-Ray API
povray_init(argc, argv);
// Define the sphere object
povray_sphere_t sphere;
sphere.center.x = 0;
sphere.center.y = 0;
sphere.center.z = 0;
sphere.radius = 1;
// Specify the properties of the sphere
povray_material_t material;
material.diffuse.red = 1;
material.diffuse.green = 0;
material.diffuse.blue = 0;
// Add the sphere to the scene
povray_add_sphere(&sphere, &material);
// Render the image
povray_render("sphere.png", 640, 480);
// Clean up
povray_cleanup();
return 0;
}
How can I install/find -lpovray library for C?
Post a reply to this message
|
|
|
|
On 2/5/23 20:20, Kima wrote:
> How can I install/find -lpovray library for C?
There is no POV-Ray C / C++ API or library.
In other words, all that is POV-Ray specific is today included as part
of the povray load module. POV-Ray itself, makes use of other libraries.
Bill P.
More of me yapping for those wishing to trudge onward...
An official API has discussed at various times in the past - and I'd
make a guess bits of the main body you posted comes from such a
discussion thread! :-)
Christoph invested considerable time trying to untangle the code
(v3.8/v4.0) to better set up for support of an API with a library build,
but that code re-factoring start is as far as work got.
It's possible to write custom C++ making use of the POV-Ray code base to
render scenes. Somewhere on the news groups Christoph worked up and
posted C++ code which manually made all the necessary calls to render a
sphere IIRC. The work was done to look at the feasibility of 'just'
coding scenes in C++ as some had suggested at the time. His conclusion
was it would be a difficult way to create and render scenes in practice.
FWIW. You can find povray.h in the 'source code' tree at:
./source/backend/povray.h. There have been changes to this file over
time, but I think v3.7/v3.8/v4.0 consistent with respect to file
location at least, though not the file's contents.
Post a reply to this message
|
|