[Radiance-general] Re: Transform from 3D to 2D Coordinates

Greg Ward [email protected]
Fri, 2 May 2003 10:26:25 +0100


Hi Jon,

Since, as you point out, I will be at Bristol Univ. next week, anyway, 
we can chat about the viewloc() function while I'm there.  I wasn't 
sure if you were one of Alan's students or somewhere else at the 
university.  The -vs and -vl options default to 0, and you need not 
worry about them.  You can use the stdview global or the STDVIEW macro 
defined in view.h to set the default view parameters.  The ip[0] and 
ip[1] variables return image position on a [0-1) scale.  You need to 
multiply these values by your image resolution to get the actual pixel 
coordinates, which is exactly what the loc2pix function is for.  It 
seems like you have figured this all out, so I'm not sure what is and 
is not working for you at this point.

Hope to see you next week.
-Greg

> From: [email protected]
> Date: Wed Apr 30, 2003  6:58:43  PM Europe/London
> To: [email protected]
> Subject: Re: [Radiance-general] Transform from 3D to 2D Coordinates
> Reply-To: [email protected]
>
> Dear Greg,
>
> Thanks a lot for you quick reply to my last question. Im sorry to 
> bother
> you again with what is probably another obvious question.
>
>  I have been spending a lot of time trying to use your 'viewloc()'
> function in my program. I believe i know what most of the parameters
> should be but i was hoping you could confirm (or correct) a few of my
> assumptions as I cannot seem to produce any correct output.
>
> Firstly, viewloc() is passed three variables ip, v and p. p is 
> obviously
> the input co-ordinates in the xyz used by the radiance coordinate
> system. v is the details of the view. ip therefore must be the output
> coordinates - are ip[0] and ip[1] the new x and y coordinates?
>
> the only v setttings that i cannot figure out the origin of is hoff and
> voff (the horizontal and vertical offsets). As i do not change many
> rendering parameters with rpict (only -vp and -vd) i am assuming these
> default to 0 - is this correct? i assume the rest of the v variables
> (i.e. hvec, vvec, hn2 etc.) are calculated in the 'setview' function.
>
> Finally, I have been passing ip[0] and ip[1] to the loc2pix function to
> convert this location to a pixel coordinate. My resolution is the
> default 512X512 and my -vv and -vh are also the default 45. Does this
> mean that loc2pix will give me an (x,y) between 0 and 512?
>
> Again sorry to bother you with this - i wouldnt ask unless i really
> couldnt sort it out myself
>
> Your help is greatly appreciated
>
> Jon Bright
>
> ps as a matter of interest i hear you are visiting my university
> (Bristol) on sunday to meet, among other people, my supervisor (Alan
> Chalmers). Small world isnt it!