POV-Ray : Newsgroups : povray.general : C API : C API Server Time
26 Apr 2024 06:11:07 EDT (-0400)
  C API  
From: Kima
Date: 5 Feb 2023 20:25:00
Message: <web.63e055d2bda0392d65103170d427f3e5@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.