POV-Ray : Newsgroups : povray.advanced-users : Converting 2D screen coordinates to 3D : Re: Converting 2D screen coordinates to 3D Server Time
26 Mar 2023 21:53:19 EDT (-0400)
  Re: Converting 2D screen coordinates to 3D  
From: Bald Eagle
Date: 6 Feb 2023 13:25:00
Message: <web.63e1453eef540dd71f9dae3025979125@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> A couple of initial (naive?) questions, to help me better-visualize the details:
> >
> > Assume an orthographic camera.
> > Let's say that I have a line segment extending from the top left of
> > an image to the lower right.
> Is that initial line an actual object in the 3-D scene that appears to extend
> from corner to corner, or is it a line only in flat 2-D screen space (like
> Screen.inc would typically produce, for example)? I'm guessing it's a 3-D
> object, extending into the scene.

That initial line is indeed an axis of the object, which would extend forward
and backward from the image plane if it were an actual 3D object.

> > If I draw a line perpendicular to this, then I can use this
> > new line as an axis for rotation.
> Perpendicular to it in x/y screen space, or pointing 'out' from the middle of
> the initial line segment directly into the camera? Or maybe pointing somewhere
> else in 3-D space? Sorry, this one is hard to visualize.

Making the line perpendicular in screen space.  Then when the z-buffer line gets
rotated it remains "in place"/in-line with where it already is, just with +/-
z-components in the vectors of the now-rotated endpoints.

> > If I rotate a copy of the line segment around this axis, it should visually
> > remain in line with the original line segment, but the ends would appear to
> > contract.
> I can sort of 'see' this...depending on whether or not I understand the initial
> stuff.

Image of work so far attached.   It's halfway there, though I'm guessing at
magic rotation angle numbers and just flying by the seat of my pants through

Apparently there's a much better way to do this that's used in multiple view
geometry in computer vision, but it uses QR decomposition and SVD, among other
matrix operations.   There are Matlab libraries to do some of this, but it would
of course be preferable to be able to do this ourselves in SDL/source.

I should probably see if I can find a copy of Hartley and Zisserman, or the more
modern text that has supplanted it - Photogrammetric Computer Vision:

related documents/threads:





Post a reply to this message

Download 'yesobjects.png' (621 KB)

Preview of image 'yesobjects.png'


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