|
 |
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmail com> wrote:
> "Bald Eagle" <cre### [at] netscape net> wrote:
> > So, let's say there are 2 views (I think that might be necessary to get Z), each
> > showing the same cube (and maybe a reference point like the origin) from a
> > different vantage point.
> > I'm presuming that a matrix would be the best way to reverse-project back to
> > where the camera should be?
> I'm not sure if I understand what you mean.
Assume you have 2 renders of something like [an] object[s] in a Cornell box
https://en.wikipedia.org/wiki/Cornell_box
(but you DON'T have the SDL written to generate said render[s] )
Presumably if there's some known reference dimension[s], then one ought to be
able
to reproduce the geometry - size, shape - of all the objects in the scene.
I assumed it might require at least a second render from a different angle -
preferably an orthogonal one, or if necessary, additional ones that reveal
occluded details.
Probably the camera angle would be needed to construct an accurate projection
matrix, as well.
I was just considering it as an extension of the discussion and experiments at
http://news.povray.org/povray.binaries.images/thread/%3C5baddad1%40news.povray.org%3E/?mtop=424795
and
http://news.povray.org/povray.advanced-users/thread/%3C5bb67852%40news.povray.org%3E/
but expanding it to deal with more data.
Collect data from analyzing / measuring one render, couple that with data from a
second render (different vantage point) and one could quickly, albeit roughly,
recreate a scene when perhaps the source was lost, unavailable, etc.
Post a reply to this message
|
 |
|
 |
Hi,
the two alternative cameras, the standard perspective camera and the
ucdPerspective camera, give different images if the pLookAt is not perfectly
<0.0, 0.0, 1.0>. Try commenting the respective row.
Can we explain and fix this?
IGM
// ###############################################
#version 3.8;
global_settings { assumed_gamma 1.0 }
#include "colors.inc"
#include "transforms.inc"
#macro ucdPerspective(pLocation,pLookAt,Angle)
#local D0_X_Fn = function(u, v) {u*image_width };
#local D0_Y_Fn = function(u, v) {v*image_height};
#local D0_Z_Fn = function(u, v) {image_width/2/tan(radians(Angle/2))};
#local LocationX = pLocation.x;
#local LocationY = pLocation.y;
#local LocationZ = pLocation.z;
#local(D1_X_Fn, D1_Y_Fn, D1_Z_Fn) =
ucdLookAtTransform(D0_X_Fn,D0_Y_Fn,D0_Z_Fn,pLocation,pLookAt,Angle);
camera {
user_defined
location {
function { LocationX }
function { LocationY }
function { LocationZ }
}
direction {
function { D1_X_Fn(u, v) }
function { D1_Y_Fn(u, v) }
function { D1_Z_Fn(u, v) }
}
}
#end
#macro ucdLookAtTransform(D0_X_Fn,D0_Y_Fn,D0_Z_Fn,pLocation,pLookAt,Angle)
#local vDirection_0 = +1*z;
#local vRight_0 = +image_width/image_height*x;
#local vUp_0 = +1*y;
//the three above should probably move to the cam definition
#local vLookAt = pLookAt - pLocation;
#local LookAtTransform = Reorient_Trans(z, vLookAt)
#local vDirection_1 = vtransform(vDirection_0, LookAtTransform);
#local vRight_1 = vtransform(vRight_0, LookAtTransform);
#local vUp_1 = vtransform(vUp_0, LookAtTransform);
#local vT1_X = vtransform(x, LookAtTransform);
#local X1_X = vT1_X.x;
#local X1_Y = vT1_X.y;
#local X1_Z = vT1_X.z;
#local vT1_Y = vtransform(y, LookAtTransform);
#local Y1_X = vT1_Y.x;
#local Y1_Y = vT1_Y.y;
#local Y1_Z = vT1_Y.z;
#local vT1_Z = vtransform(z, LookAtTransform);
#local Z1_X = vT1_Z.x;
#local Z1_Y = vT1_Z.y;
#local Z1_Z = vT1_Z.z;
#local D1_X_Fn =
function(u, v) {
0
+ X1_X*D0_X_Fn(u, v)
+ Y1_X*D0_Y_Fn(u, v)
+ Z1_X*D0_Z_Fn(u, v)
};
#local D1_Y_Fn =
function(u, v) {
0
+ X1_Y*D0_X_Fn(u, v)
+ Y1_Y*D0_Y_Fn(u, v)
+ Z1_Y*D0_Z_Fn(u, v)
};
#local D1_Z_Fn =
function(u, v) {
0
+ X1_Z*D0_X_Fn(u, v)
+ Y1_Z*D0_Y_Fn(u, v)
+ Z1_Z*D0_Z_Fn(u, v)
};
(D1_X_Fn, D1_Y_Fn, D1_Z_Fn)
#end
#declare pLocation = <0.0, 0.5, -0.0>;
#declare pLookAt = <0.5, 0.0, 1.0>;
#declare Angle = 90;
// Alternative cameras
ucdPerspective(pLocation,pLookAt,Angle)
// camera { angle Angle right image_width/image_height*x up y location pLocation
look_at pLookAt }
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
#declare SphereRadius = 0.3;
sphere { < 0, 0, 2>, SphereRadius pigment { checker White Black } }
sphere { < 0, 0, -2>, SphereRadius pigment { checker White Red } }
sphere { < 2, 0, 0>, SphereRadius pigment { checker White Green } }
sphere { <-2, 0, 0>, SphereRadius pigment { checker White Blue } }
union {
sphere { < 0, 0, 2>, SphereRadius pigment { White } }
sphere { < 0, 0, -2>, SphereRadius pigment { Red } }
sphere { < 2, 0, 0>, SphereRadius pigment { Green } }
sphere { <-2, 0, 0>, SphereRadius pigment { Blue } }
translate 0.5*y
}
background { color Gray80 }
light_source { <1, 1, -1>*100 White }
light_source { <0, 0, 0> Gray20 }
Post a reply to this message
|
 |