POV-Ray : Newsgroups : povray.advanced-users : Depth output from POVray Server Time
30 Jul 2024 16:19:02 EDT (-0400)
  Depth output from POVray (Message 21 to 23 of 23)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bald Eagle
Subject: Re: Depth output from POVray
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

From: Mike Horvath
Subject: Re: Depth output from POVray
Date: 27 Feb 2019 20:57:43
Message: <5c774017$1@news.povray.org>
On 2/26/2019 8:22 PM, Bald Eagle wrote:
> "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.
> :)
> 
> 


Shouldn't each pixel have four corners that need to be measured?


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Depth output from POVray
Date: 27 Feb 2019 20:58:25
Message: <5c774041$1@news.povray.org>
On 2/27/2019 8:57 PM, Mike Horvath wrote:
> Shouldn't each pixel have four corners that need to be measured?
> 
> 
> Mike

That was probably a stupid question. :(

Mike


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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