POV-Ray : Newsgroups : povray.advanced-users : Using povray library : Using povray library Server Time
3 Jul 2024 04:53:30 EDT (-0400)
  Using povray library  
From: AIV Developer
Date: 17 Jul 2008 17:25:00
Message: <web.487fb81042e71f2be52a5a10@news.povray.org>
Hello all,

I am developing an application which involves a virtual environment. I want to
have a (set of) virtual camera(s) and objects in a scene, and all of these are
going to be changed semi-interactively (doesn't have to be real-time.) I like
to use povray to achieve this. Let me ask my question with a pseudo-code. I
like to have a coding structure that looks like this:

****** Code Starts ******
#include "povray_api.h"

int main_loop(void) {
  povray_scene scene;
  cam_id1 = scene.camera_add( my_cam_params_1 );
  cam_id2 = scene.camera_add( my_cam_params_2 );

  scene.add_box( ...parameters... );
  // we add all the objects and light sources here
  // ...

  while (loop_flag) {
    scene.render(cam_id1, &image1);
    scene.render(cam_id2, &image2);

    // send the images to wherever...

    // modify the scene (change object and camera positions, etc...)

  }

}
****** Code Ends ******

I want this because the overhead of creating a pov file (scene file), calling
the "povray" executable then parsing it for every frame is significant. My
scene is simple and does not change a lot. On top of above reasons, in
principle, reprocessing a scene should be faster as well.

Would this be easily possible with povray libs? Any pointers will be
appreciated.

Cheers!


Post a reply to this message

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