Hi Luther,
if you are using c4doctane, please have a look at this Xpresso example, where you can change the reference Camera:
viewtopic.php?f=87&t=63808
ciao Beppe
shader CameraMap_geo(
output point uvw = 0)
{
vector p = transform("Camera.001", P);
float fov;
int res[2];
getattribute("camera:fov", fov);
getattribute("camera:resolution", res);
uvw[0] = .5 - .5 * p[0] / p[2] / tan(fov / 2) ;
uvw[1] = .5 - .5 * p[1] / p[2] / tan(fov / 2) * res[0] / res[1];
}
shader CameraMap_geo(
output point uvw = 0)
{
vector p = transform("Camera.001", P);
float fov;
int res[2];
getattribute("camera:fov", fov);
getattribute("camera:resolution", res);
uvw[0] = 0.5 - 0.5 * p[0] / p[2] / tan(fov / 2) ;
uvw[1] = 0.5 - 0.5 * p[1] / p[2] / tan(fov / 2) * res[0] / res[1];
}
Return to Resources and Sharing
Users browsing this forum: No registered users and 59 guests