|
|
I am trying to duplicate the camera angle in a scene with a box mapped
with the image, but when I use certain camera positions and look
combinations, it rotates the image along the z axis. It seems to happen
when the Camera position and look position don't have the same y value.
How can i fix this?
here is a stripped down version. If the "doesn't work' part is commented
out it works fine.
I must admit, I don't always know when to use Reorient_Trans() vs
vrotate() vs VAngleD() and even less how to use them. It gets confusing.
//-----------------------------------//
// begin code
#version 3.7;
global_settings { max_trace_level 5 assumed_gamma 1}
#include "Transforms.inc"
//works:
#declare CamPos= <0.5, 1.5,4.5 >;
#declare CamLook= <1.3,1.5,0>;
///////////////////////////////////
// doesn't work:
#declare CamPos= <0.5, 1.5,4 >;
#declare CamLook= <1.3,1.2,0>;
//////////////////////////////////
#declare CamDirect=<0,0,1>;
#declare CamWidth=image_width;
#declare CamHeight=image_height;
#declare ColMapPig=pigment {image_map { png "test.png" }
translate -0.5*(x+y)
scale <CamWidth/CamHeight,1,1>*2
}
box{<-CamWidth/CamHeight,-1,CamDirect.z>,<CamWidth/CamHeight,1,CamDirect.z+0.001>//}
texture {
pigment {ColMapPig}
finish { ambient 1 diffuse 1}
}
translate CamDirect
Reorient_Trans(z, (CamLook-CamPos))
translate CamPos
}
#declare ColMap="test.png"
///////////////////////////////////////////////////
camera {
location CamPos
direction CamDirect
right x*image_width/image_height
look_at CamLook
}
// End code
//-------------------------//
//--
-Nekar Xenos-
Post a reply to this message
|
|