[Radiance-general] Transform from 3D to 2D Coordinates
Greg Ward
[email protected]
Tue, 29 Apr 2003 09:28:51 -0700
Hi Jon,
Focal length is specified with the -vh and -vv options of rpict, which
also controls the image aspect ratio. Knowing one from the other
requires a specific image (film) size and format. For 35mm film, the
formula is:
focal_length = 35/2 / tan(vv_angle/2)
Where vv_angle is the vertical view angle for a landscape picture. The
horizontal angle is then given by:
hh_angle = 2 * atan(vv_angle/2 * 3/2)
To check your calcs, a 50mm lens in 35mm photography is equivalent to a
Radiance view specification of:
-vh 49.6 -vv 35.3
(Remember that many trigonometric libraries including those used by
Radiance's "calc" program deal in radians, and you need to convert this
using 180/PI.)
I hope the above exercise makes it clear why I didn't choose focal
length in definining views in rpict -- they don't make a lot of sense.
There are also Radiance library routines you can access from C-code.
Check out the viewloc() function in src/common/image.c and some of the
other routines there.
Good luck!
-Greg
> From: [email protected]
> Date: Mon Apr 28, 2003 12:25:41 PM US/Pacific
> To: [email protected]
> Subject: [Radiance-general] Transform from 3D to 2D Coordinates
> Reply-To: [email protected]
>
> Dear Radiance list,
>
> I am currently using radiance to render some pictures which I would
> like
> to apply some post processing to. This will involve pasting an image
> onto a specific location in the .pic file i have created.
>
> In order to do this i need to know the location of certain points. I
> know where they are in my 3D scene, but cannot work out a 3D to 2D
> coordinate transform. I know that with a traditional pinhole
> perspective
> projection i can work out new 2D coordinates if i know the old
> coordinates, the focal point and the focal length. But i cant find any
> way of determining what the focal length used by rpict is!
>
> If anyone has, ideally, an equation for transforming 3D radiance
> coordinates into 2D .pic coordinates based on an (x,y,z), view point
> and
> view direction i would be incredibly grateful if you could let me know.
> And if anyone could even help me determine the focal length i need that
> would be a big help
>
> Thanks a lot for your time
>
> Jon Bright
> _______________________________________________
> Radiance-general mailing list
> [email protected]
> http://www.radiance-online.org/mailman/listinfo/radiance-general
>