function CreateWorldBodies( P_c,P_j,P_f,P_t,z_gnd,L )
%__________________________________________________________________________
% in_args: P_l, coordinates of the point joints
%          P_j, coordinates of the joint cylinders
%          P_f, coordinates of the foot
%          P_t, coordinates of the foot's trace 
%          L, arm's link lenghts
% out_args: none
%
% Mechanical links
 l1 = L(1); l1_1 = L(2); l1_2 = L(3); l2 = L(4); l3 = L(5);
% Robot's leg 
 figure(1), [AZ,EL] = view; clf
 H1= plot3( P_c(1,:),P_c(2,:),P_c(3,:),'r');
 set(H1,'LineWidth', 5.0)
 xlabel(' X (m) '), ylabel(' Y (m) '), zlabel(' Z (m) ')
 axis('equal'), axis('off')
 axis([-(l1+l2+l3)/2 (l1+l2+l3)/2 -(l1+l2+l3)/2 (l1+l2+l3)/2 ...
       -0.02 l1+l2+l3+0.02])
 if AZ == 0 & EL == 90, view(40,25)
 else view(AZ,EL), end
 hold on
% Ground surface
 fill3([-0.4 0.4 0.4 -0.4],[-0.4 -0.4 0.4 0.4],[z_gnd z_gnd z_gnd z_gnd],'w')
 
% Rotational joints
 surf([P_j(1,:,1);P_j(2,:,1)],[P_j(3,:,1);P_j(4,:,1)],[P_j(5,:,1);P_j(6,:,1)]) 
 surf([P_j(1,:,2);P_j(2,:,2)],[P_j(3,:,2);P_j(4,:,2)],[P_j(5,:,2);P_j(6,:,2)])
 surf([P_j(1,:,3);P_j(2,:,3)],[P_j(3,:,3);P_j(4,:,3)],[P_j(5,:,3);P_j(6,:,3)])
 surf([P_j(1,:,4);P_j(2,:,4)],[P_j(3,:,4);P_j(4,:,4)],[P_j(5,:,4);P_j(6,:,4)]) 
 surf([P_j(1,:,5);P_j(2,:,5)],[P_j(3,:,5);P_j(4,:,5)],[P_j(5,:,5);P_j(6,:,5)]) 
 surf([P_j(1,:,6);P_j(2,:,6)],[P_j(3,:,6);P_j(4,:,6)],[P_j(5,:,6);P_j(6,:,6)]) 
% Foot (double face)
 fill3(P_f(1,:,1),P_f(2,:,1),P_f(3,:,1),'r', P_f(1,:,2),P_f(2,:,2),P_f(3,:,2),'r');
 H2 = plot3(P_f(1,:,1),P_f(2,:,1),P_f(3,:,1),'k', P_f(1,:,2),P_f(2,:,2),P_f(3,:,2),'k');  
 set(H2,'LineWidth', 2.0)
% Trace
 plot3(P_t(1,:),P_t(2,:),P_t(3,:),'b-.',...
       P_t(1,:),P_t(2,:),P_t(3,:),'b-.')
%__________________________________________________________________________
end