function out = cam_obj(cam,scl)

out = cam;
%pos = [5 10 5];
%target = [0 0 0];
pos = cam.pos;
target = cam.target;
% va = 30;

vn = target  - pos;
up = [0 0 1];
vz = vn/norm(vn);
vx = cross(vz,up);
vx = vx/norm(vx);
vy = cross(vz,vx);
Rc = [vx; vy; vz;];
T = [Rc -Rc*pos'];
out.T = T;

b = 1;
%scl = 2;

fr = [-scl -scl b 1; scl -scl b 1; scl scl b 1; -scl scl b 1; -scl -scl b 1];
Tinv = [Rc' pos'];
out.Tinv = Tinv;
pts = Tinv*fr';
% mypts = pos'*ones(1,2) + [ zeros(3,1) b*vz' ];
% plot3(mypts(1,:),mypts(2,:),mypts(3,:),'b','LineWidth',3);

plot3(pts(1,:),pts(2,:),pts(3,:),'k');
% draw from center to edges of plot
line([pos(1)*ones(1,5);  pts(1,:)],[pos(2)*ones(1,5); pts(2,:)],[pos(3)*ones(1,5); pts(3,:)],'Color',[0 0 0]);
% for k=1:4
%     text(pts(1,k),pts(2,k),pts(3,k),sprintf('%d',k));
% end
ndx = [4 1 2];
plot3(pts(1,ndx),pts(2,ndx),pts(3,ndx),'m','LineWidth',2);
k=2;
text(pts(1,k),pts(2,k),pts(3,k),'X');
k=4;
text(pts(1,k),pts(2,k),pts(3,k),'Y');