POV-Ray : Newsgroups : povray.programming : view.cpp StartRender function and camera parameters : Re: view.cpp StartRender function and camera parameters Server Time
25 Apr 2024 04:12:41 EDT (-0400)
  Re: view.cpp StartRender function and camera parameters  
From: Le Forgeron
Date: 11 Jul 2011 15:09:05
Message: <4e1b4a51$1@news.povray.org>
Le 11/07/2011 20:21, handos nous fit lire :
> Hi everyone,
> 
> I wanted to obtain depth-map from POVRay 3.7 and I figured out that I could get
> the output from TraceRay function defined in (trace.cpp) and store it in array
> and then write it into a file. I was doing it very conveniently after the
> renderTask.AppendTask( new TraceTask(..)) function call defined in view.cpp's
> StartRender() function. However when the image takes a bit longer time to
> render, the function returns from StartRender() while already running the
> threads in TraceTask. I tried to go through the code to understand at what point
> can I write the depth-map array but I totally got confused with backend frontend
> thing. If it's not very difficult to figure out could anyone please tell me
> where exactly can I write the depth-array (already stored) into a file at which
> point where all threads have finished.

Find the moment the metadata are written in the output image.
Who call Image::Write in base/image/image.cpp ?
(hint, it's in ImageProcessing::WriteImage, in frontend/imageprocessing.cpp)

> 
> Also, I'd like to write the camera parameters into a file too, once you specify
> the parameters into the camera{ } object in povray file, where exactly it
> applies all the various transformation defined within the camera{} Object and
> latches the final camera_position, camera_up and camera_direction? As an
> instructive example
> 
> camera{
> location <x,y,z>
> direction <a,b,c>
> up <ux,uy,uz>
> matrix <    val00,    val01,  val02,
>    val10,   val11,    val12,
>    val20,   val21,    val22,
>    val30,   val31, val32>
> };
> 
> After applying the necessary transformation, where exactly does it store the
> final direction, up vector and position vector in the code?

I have that information (used for a camera_... access patch, not in 3.7)
The main trick is that you might have one (usual) camera, or more
cameras (for a special mode of rendering: same scene, many camera)

So, it's either sceneData->parsedCamera or sceneData->cameras[idx]
+ .Location,
+ .Direction,
+ .Right,
+ .Up

I guess you can match the ends.


Post a reply to this message

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