clear
ddLon = -121.831286;
ddLat = 36.779395;
heading = 180;
llIncr = .01/60.0;
hdgIncr = 3.0;


for i = 1:30
    i
    fid = fopen('mParagon.kml','w');
    ddLon = ddLon + llIncr;
    ddLat = ddLat + llIncr;
    heading = heading + hdgIncr;
    
    fprintf(fid, '<?xml version="1.0" encoding="UTF-8"?>\n');
    fprintf(fid, '<kml xmlns="http://www.opengis.net/kml/2.2">\n');
    fprintf(fid, '	<name>BoatTest</name>\n');
    fprintf(fid, '		<Placemark>\n');
    fprintf(fid, '			<name>Paragon</name>\n');
    fprintf(fid, '			<Style id="default">\n');
    fprintf(fid, '			</Style>\n');
    fprintf(fid, '			<Model id="model_5">\n');
    fprintf(fid, '				<altitudeMode>ClampToGround</altitudeMode>\n');
    fprintf(fid, '				<Location>\n');
    fprintf(fid, '					<longitude>%10.6f</longitude>\n', ddLon);
    fprintf(fid, '					<latitude>%9.6f</latitude>\n', ddLat);
    fprintf(fid, '					<altitude>0.0</altitude>\n');
    fprintf(fid, '				</Location>\n');
    fprintf(fid, '				<Orientation>\n');
    fprintf(fid, '					<heading>%5.1f</heading>\n', heading);
    fprintf(fid, '					<tilt>0</tilt>\n');
    fprintf(fid, '					<roll>0</roll>\n');
    fprintf(fid, '				</Orientation>\n');
    fprintf(fid, '				<Scale>\n');
    fprintf(fid, '					<x>1</x>\n');
    fprintf(fid, '					<y>1</y>\n');
    fprintf(fid, '					<z>1</z>\n');
    fprintf(fid, '				</Scale>\n');
    fprintf(fid, '				<Link>\n');
    fprintf(fid, '					<href>C:\\Users\\Gene\\Documents\\MBARI\\ProfilingFloat\\floatChart\\genericBoat.dae</href>\n');
    fprintf(fid, '			    </Link>\n');
    fprintf(fid, '				<ResourceMap>\n');
    fprintf(fid, '					<Alias>\n');
    fprintf(fid, '						<targetHref></targetHref>\n');
    fprintf(fid, '						<sourceHref></sourceHref>\n');
    fprintf(fid, '					</Alias>\n');
    fprintf(fid, '				</ResourceMap>\n');
    fprintf(fid, '			</Model>\n');
    fprintf(fid, '		</Placemark>\n');
    fprintf(fid, '</kml>\n');
    
    fclose(fid);
    pause(2);
end
