POV-Ray : Newsgroups : povray.advanced-users : Converting 2D screen coordinates to 3D : Re: Converting 2D screen coordinates to 3D Server Time
4 May 2024 10:49:12 EDT (-0400)
  Re: Converting 2D screen coordinates to 3D  
From: Bald Eagle
Date: 11 Feb 2023 12:50:00
Message: <web.63e7d4f6ef540dd71f9dae3025979125@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

> Nope, no trace() in Screen.inc, just some math wizardry and a matrix. It might
> be worth a look, just to see if something there could be reverse-engineered.

Right, sorry - I still had the "screen position finder" thing in my head...


screen.inc doesn't do anything except organize things into a well-defined box
that exactly matches the view frustum of the camera.  The box is squished very
thin, and positioned so that it fills the entire camera from edge to edge.

So no, it still doesn't "convert 3D coordinates to 2D coordinates".   What it
does allow you to do is use <u, v> values of the image plane to place 3D objects
at that location.  That's why those values are in the -0.5 to 0.5 range But all
that does is define the image plane as a constant z-value (or some distance
along whatever vector the view the direction is defined as).

The matrix just rotates all of that into position when the camera isn't in the
default position, so that it all lines up.

// Note that even though objects aligned using screen.inc follow the
// camera, they are still part of the scene. That means that they will be
// affected by perspective, lighting, the surroundings etc.


So, it's related to the solution, in that one can correlate the <u, v> values
with a RAY that extends through an infinite number of z-values, but the trick is
- which z value?


Post a reply to this message

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