POV-Ray : Newsgroups : povray.advanced-users : Depth output from POVray : Re: Depth output from POVray Server Time
30 Jul 2024 16:14:21 EDT (-0400)
  Re: Depth output from POVray  
From: Bald Eagle
Date: 26 Feb 2019 20:25:01
Message: <web.5c75e65650a5b280765e06870@news.povray.org>
"muyu" <lsy### [at] gmailcom> wrote:

> Thanks for your answer. Your work on the trace macro is very interesting!
> However, I did not know how to do that for all the pixels and output the
> coordinates information. Could you please provide a small code example?
> (Sorry for this greedy request.) Thanks again.

I'll see what I can work out.
I can't recall where we all left off with this, so I'll have to pick through it
again.  It's good practice anyway  ;)

The thing you want to do is look at the macro call.
pos_finder (SURFACE, CL, LA, Angle, screen_x_position, screen_y_position, 1.0)

SURFACE is the collection of abjects in the scene
CL - camera location
LA - look at
Angle - camera angle
screen_x_position
screen_y_position
1.0 - no idea what this is at the moment.  :D

So basically the idea is to just plop that into a nested x-y loop, and have it
spit out the location vector of where the trace() ray intersects the scene
objects.  Probably the best way if to write it to a file.

I think I had some free time when I was helping to work this out, but less so
now, so it may take a while.
But I'd say that the end goal would be to package it all up into a macro that
will scan the whole view frustum and output the visible surface vectors to a
file.

Might be fun to have the option to write the pigment data to file as well with
eval_pigment, and then reconstruct the scene with pixel-sized boxes or spheres.
:)


Post a reply to this message

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