figureview(3)grid on%lorry
vertices_lorry = [0 1 0.5 ; 4 1 0.5; 6.5 1 0.5; 6.5 1 1.2; 6 1 1.3;... 5 1 1.8; 4 1 1.8; 4 1 2; 0 1 2; ... % postive y of lorry 0 -1 0.5; 4 -1 0.5; 6.5 -1 0.5; 6.5 -1 1.2; 6 -1 1.3;... 5 -1 1.8; 4 -1 1.8; 4 -1 2; 0 -1 2]; % negative y of lorry
faces_lorry_cargo = [10 1 9 18; 1 2 8 9; 8 9 18 17; 10 11 17 18; 7 8 17 16;... 1 2 11 10];faces_lorry_driver = [7 6 15 16 16 16; 5 6 15 14 14 14; 5 4 13 14 14 14;... 3 4 13 12 12 12; 2 3 4 5 6 7; 11 12 13 14 15 16; 2 3 12 11 11 11];patch('Faces',faces_lorry_cargo,'Vertices',vertices_lorry,'FaceColor','#86DA7D','EdgeColor','k');patch('Faces',faces_lorry_driver,'Vertices',vertices_lorry,'FaceColor','#868686','EdgeColor','k');
I am trying to build a truck in Matlab but I cannot figure out how to place 4 different half cylinder "wheels" on the bottom. How can I do this?
The wheels should go around 180 deg from the bottom. the rear wheel is centered 1m from the back and the wheel base is 3.95. the wheels are 0.2m thick.
Best Answer