function CreateWorldBodies( P_l,P_r,C_l,C_r,T_l,T_r,P_trace_l,P_trace_r,L )
%__________________________________________________________________________
% in_args: P, coordinates of the point joints
%          C, coordinates of the joint cylinders
%          T, coordinates of the arm's tooltip
%          L, arm's link lenghts
% out_args: none
%
% Mechanical links
 lt = L(1); lt_l = L(2); lt_w = L(3); lt_h = L(4); 
 lr = L(5); l0 = L(6); 
 l1 = L(7); l1_1 = L(8); l1_2 = L(9); l2 = L(10);
% Left arm 
 figure(1), [AZ,EL] = view; clf
 H1= plot3( P_l(1,:),P_l(2,:),P_l(3,:),'r', P_r(1,:),P_r(2,:),P_r(3,:),'r');
 set(H1,'LineWidth', 5.0)
 xlabel(' X (m) '), ylabel(' Y (m) '), zlabel(' Z (m) ')
 axis('equal'), axis('off')
 if AZ == 0 & EL == 90, view(120,10)
 else view(AZ,EL), end
 hold on
%  plot3(track(1,:),track(2,:),track(3,:),'b-.')% Ground surface 
% Robot's trunk
 [X,Y,Z] = cylinder(1,100);
 X = 0.5*lr*X; Y = 0.5*lr*Y; Z = 8*lr*Z;
 surf(X,Y,Z)
 
 lt_h = lt_h+1e-2;
 fill3( [lt_w/2 lt_w/2 -lt_w/2 -lt_w/2],...
        [-lt_l/2 lt_l/2 lt_l/2 -lt_l/2],[lt+lt_h lt+lt_h lt+lt_h lt+lt_h],'b')
 fill3( [lt_w/2 lt_w/2 -lt_w/2 -lt_w/2],...
        [-lt_l/2 lt_l/2 lt_l/2 -lt_l/2],[lt lt lt lt],'b')
 fill3( [lt_w/2 -lt_w/2 -lt_w/2 lt_w/2],...
        [lt_l/2 lt_l/2 lt_l/2 lt_l/2],[lt lt lt+lt_h lt+lt_h],'b')
 fill3( [-lt_w/2 lt_w/2 lt_w/2 -lt_w/2],...
        [-lt_l/2 -lt_l/2 -lt_l/2 -lt_l/2],[lt lt lt+lt_h lt+lt_h],'b')
 fill3( [-lt_w/2 lt_w/2 0],[lt_l/2 lt_l/2 0],[lt lt 8*lr],'b')
 fill3( [-lt_w/2 lt_w/2 0],[-lt_l/2 -lt_l/2 0],[lt lt 8*lr],'b')
 axis 'equal', axis 'off'
 axis([-0.65 0.65 -0.65 0.65 -0.15 0.65]),  
% Rotational joints
 surf([C_l(1,:,1);C_l(2,:,1)],[C_l(3,:,1);C_l(4,:,1)],[C_l(5,:,1);C_l(6,:,1)]) 
 surf([C_l(1,:,2);C_l(2,:,2)],[C_l(3,:,2);C_l(4,:,2)],[C_l(5,:,2);C_l(6,:,2)])
 surf([C_l(1,:,3);C_l(2,:,3)],[C_l(3,:,3);C_l(4,:,3)],[C_l(5,:,3);C_l(6,:,3)])
 surf([C_l(1,:,4);C_l(2,:,4)],[C_l(3,:,4);C_l(4,:,4)],[C_l(5,:,4);C_l(6,:,4)]) 
 
 surf([C_r(1,:,1);C_r(2,:,1)],[C_r(3,:,1);C_r(4,:,1)],[C_r(5,:,1);C_r(6,:,1)]) 
 surf([C_r(1,:,2);C_r(2,:,2)],[C_r(3,:,2);C_r(4,:,2)],[C_r(5,:,2);C_r(6,:,2)])
 surf([C_r(1,:,3);C_r(2,:,3)],[C_r(3,:,3);C_r(4,:,3)],[C_r(5,:,3);C_r(6,:,3)])
 surf([C_r(1,:,4);C_r(2,:,4)],[C_r(3,:,4);C_r(4,:,4)],[C_r(5,:,4);C_r(6,:,4)]) 
% Tooltip 
  H2= plot3(T_l(1,:),T_l(2,:),T_l(3,:),'r', T_r(1,:),T_r(2,:),T_r(3,:),'r');
  set(H2,'LineWidth', 3.0)
% Trace
 plot3(P_trace_l(1,:),P_trace_l(2,:),P_trace_l(3,:),'b-.',...
       P_trace_r(1,:),P_trace_r(2,:),P_trace_r(3,:),'b-.')
%__________________________________________________________________________
end