POV-Ray : Newsgroups : povray.general : Projecting a photograph on to a 3D model : Re: Projecting a photograph on to a 3D model Server Time
31 Jul 2024 02:32:00 EDT (-0400)
  Re: Projecting a photograph on to a 3D model  
From: Trevor G Quayle
Date: 5 Dec 2007 16:55:01
Message: <web.47571dd1a7accdbbc150d4c10@news.povray.org>
"Mark Karaska" <mka### [at] mitreorg> wrote:
> Hi,
> I have a photograph of a city taken from a plane showing the sides of
> buildings. I'd like to project the photo on to my 3D model of the city.
>
> Can POVRAY do this?
> Thanks,
> Mark

Yes, but it can be tricky.
1) You need the proportions of the building sizes of the model to match fairly
close to the actual buildings.  Even so, you can expect some pixel 'leak'
around hard edges of the model as the image map is just a bunch of square
pixels with a finite resolution, shouldn't be too much of a concern though.

2) You need to get the orientation of the image_map correct.

3) This one's a bit tougher maybe.  A standard image map is projected parallel,
all the pixels run continuously straight, however, the image will have been
taken from a camera, so will not have a parallel projection.  The larger the
viewing angle of the camera, the more distorted this can be.  If it's a fairly
tight angle (i.e. was taken with a zoom lens), then the differences may be
unnoticeable.  However if it is a larger angle projection, you may need to look
at distorting the image map.  The best way for this may be to turn it into a
function and apply it with spherical warping.  For example, lets assume your
image is square, and was taken with a 60deg field of view.  A full spherical
map will cover 360deg across and 180deg up/down, so you need to you need to
scale your image to suit this.  Spherical image map is 1unit x 1unit, your
image should be scaled so it is 60/360 units by 60/180 units in the center of
the 1x1 square to be mapped.  Then you need to get the spherical centre placed
properly (i.e, where the camera was in relation to the real buildings) and
oriented properly.

Hope this makes sense somewhat.

-tgq


Post a reply to this message

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