Re: Calculating normalized patch coords from pixel coords?
Status: Alpha
Brought to you by:
cwalther
|
From: Christian W. <cwa...@gm...> - 2010-03-27 16:21:32
|
> In order to have a patch work across 3d space, and not be hindered
> by the seperate cube faces, I wondered if there was a way to
> calculate, with the 2D coords(e.g. face 1, 342, 567) the equivilent
> in 3D coords?
Sure, you have everything you need. You can get the pixel dimensions
of the background face from 'w, h =
pipmak.getimage("myface.jpeg"):size()', and the geometrical
arrangement of the face images in 3D space is shown in figures 2 and 3
in the manual. An edge of the cube is two units in normalized units
and (w-1) or (h-1) in pixels, which gets you the scale factor, and as
a fixed point you know that (w/2, h/2) in pixels is (0, 0, -1) in
normalized coordinates (the center of the face), for face 1, and so on
for the other faces as shown in figure 2.
-Christian
|