unit frmMain;

interface

uses
  Windows, Messages, Classes, Graphics, Forms, ExtCtrls, Menus,
  Controls, Dialogs, SysUtils, OpenGL, Mesh, StdCtrls, mmsystem;

type
  TfrmGL = class(TForm)
    MainMenu1: TMainMenu;
    N1: TMenuItem;
    OpenDialog: TOpenDialog;
    N2: TMenuItem;
    NSmooth: TMenuItem;
    N21: TMenuItem;
    N22: TMenuItem;
    N31: TMenuItem;
    ballet1: TMenuItem;
    chacha1: TMenuItem;
    dancehop1: TMenuItem;

    N3: TMenuItem;
    N11: TMenuItem;
    N23: TMenuItem;
    N32: TMenuItem;
    Panel1: TPanel;
    N4: TMenuItem;
    N5: TMenuItem;
    N6: TMenuItem;
    N7: TMenuItem;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Edit6: TEdit;
    Edit7: TEdit;
    N12: TMenuItem;
    N111: TMenuItem;
    N121: TMenuItem;
    N131: TMenuItem;
    N141: TMenuItem;
    N151: TMenuItem;
    N161: TMenuItem;
    N171: TMenuItem;
    N8: TMenuItem;
    N181: TMenuItem;
    N191: TMenuItem;
    N201: TMenuItem;
    N211: TMenuItem;
    N221: TMenuItem;
    procedure FormCreate(Sender: TObject);
    procedure FormResize(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure N1Click(Sender: TObject);
    procedure N2Click(Sender: TObject);
    procedure NSmoothClick(Sender: TObject);
    procedure N31Click(Sender: TObject);
    procedure ballet1Click(Sender: TObject);
    procedure chacha1Click(Sender: TObject);
    procedure dancehop1Click(Sender: TObject);

    procedure N11Click(Sender: TObject);
    procedure N23Click(Sender: TObject);
    procedure N32Click(Sender: TObject);
    procedure N5Click(Sender: TObject);
    procedure N6Click(Sender: TObject);
    procedure N7Click(Sender: TObject);
    procedure N12Click(Sender: TObject);
    procedure l1Click(Sender: TObject);
    procedure N3Click(Sender: TObject);
    procedure N111Click(Sender: TObject);
    procedure N121Click(Sender: TObject);
    procedure N131Click(Sender: TObject);
    procedure N141Click(Sender: TObject);
    procedure N151Click(Sender: TObject);
    procedure N161Click(Sender: TObject);
    procedure N171Click(Sender: TObject);
    procedure FormClick(Sender: TObject);
    procedure N8Click(Sender: TObject);
    procedure N181Click(Sender: TObject);
    procedure N191Click(Sender: TObject);
    procedure N201Click(Sender: TObject);
    procedure N211Click(Sender: TObject);
    procedure N221Click(Sender: TObject);


  private
    DC: HDC;
    hrc: HGLRC;
    lastx, down : Integer;
    Bitmap,Bitmap1: TBitmap;
  Bits: Array [0..63, 0..63, 0..2] of GLubyte;
  Bits1: Array [0..63, 0..63, 0..2] of GLubyte;

    str2:string;
    shag,shag1,chislo,stop,stop1,stop2,stop3,stop4,stop5,stop6,stop7,stop8:integer;
    num1,num2,num3,num4,num5,num6,num7,num8,num9:integer;
    plamia:integer;
    procedure Init;
    procedure SetDCPixelFormat;
    procedure BmpTexture;
    procedure BmpTexture1;
  protected
    procedure WMPaint(var Msg: TWMPaint); message WM_PAINT;
  end;


var

  frmGL: TfrmGL;
  Angle : GLfloat = 0;
  Step : GLfloat = 1;
  wrkStep : GLfloat = 1;
  wrkTime : longint;
  wrkX, wrkY : Integer;
  MyMesh,MyMesh1,MyMesh2,MyMesh3,MyMesh4,MyMesh5,MyMesh6,MyMesh7,MyMesh8,
  MyMesh9,MyMesh10,MyMesh11,MyMesh12,MyMesh13,MyMesh14,MyMesh15,MyMesh16,
  MyMesh17,MyMesh18,MyMesh19,MyMesh20,MyMesh21,MyMesh22,MyMesh23,MyMesh24,
  MyMesh25,MyMesh26,MyMesh27,MyMesh28,MyMesh29,MyMesh30,MyMesh31,MyMesh32
  ,MyMesh33,MyMesh34,MyMesh35,MyMesh36 : TGLMultyMesh; // Многосетчатый объект
  MyMesh37 : TGLMultyMesh;  //персонаж
  MyMesh38,MyMesh39,MyMesh40,MyMesh41
  ,MyMesh42,MyMesh43,MyMesh44,MyMesh45 : TGLMultyMesh; // Многосетчатый объект
   x:integer;
           sluch:integer;
   povorot:integer;
   location:integer;
   plamia:integer;
   mashtabeffect,mashtabeffect1:integer;
   i:integer;
    nx, ny, nz : GLfloat;
    nx1, ny1, nz1 : GLfloat; //дуб
    nx2, ny2, nz2 : GLfloat;
    nx3, ny3, nz3 : GLfloat;
    nx4, ny4, nz4 : GLfloat;
    nx5, ny5, nz5 : GLfloat;
    nx6, ny6, nz6 : GLfloat;
    nx7, ny7, nz7 : GLfloat;
    nx8, ny8, nz8 : GLfloat;
    nx9, ny9, nz9 : GLfloat;
    nx10, ny10, nz10 : GLfloat;
    nx11, ny11, nz11 : GLfloat;
    nx12, ny12, nz12 : GLfloat;
    nx13, ny13, nz13 : GLfloat;
    nx14, ny14, nz14: GLfloat;
    nx15, ny15, nz15: GLfloat;
    nx16, ny16, nz16: GLfloat;
    nx17, ny17, nz17: GLfloat;
    nx18, ny18, nz18: GLfloat;
    nx19, ny19, nz19: GLfloat;
    nx20, ny20, nz20: GLfloat;
    nx21, ny21, nz21: GLfloat;
    nx22, ny22, nz22: GLfloat;
    nx23, ny23, nz23: GLfloat;
    nx24, ny24, nz24: GLfloat;
    nx25, ny25, nz25: GLfloat;
    nx26, ny26, nz26: GLfloat;
    cvetx, cvety, cvetz: GLfloat;
    nx27, ny27, nz27: GLfloat;
    nx28, ny28, nz28: GLfloat;
    nx29, ny29, nz29: GLfloat;
    nx30, ny30, nz30: GLfloat;
    nx31, ny31, nz31: GLfloat;
    nx32, ny32, nz32: GLfloat;
    nx33, ny33, nz33: GLfloat;
    nx34, ny34, nz34: GLfloat;
    nx35, ny35, nz35: GLfloat;
    nx36, ny36, nz36: GLfloat;
    nx37, ny37, nz37: GLfloat;
    nx38, ny38, nz38: GLfloat;
    nx39, ny39, nz39: GLfloat;
    nx40, ny40, nz40: GLfloat;
    nx41, ny41, nz41: GLfloat;
    nx42, ny42, nz42: GLfloat;
    nx43, ny43, nz43: GLfloat;
    nx44, ny44, nz44: GLfloat;
    nx45, ny45, nz45: GLfloat;
    nx46, ny46, nz46: GLfloat;
    nx47, ny47, nz47: GLfloat;
    nx48, ny48, nz48: GLfloat;
    nx49, ny49, nz49: GLfloat;
    nx50, ny50, nz50: GLfloat;
    //2
    nx51, ny51, nz51: GLfloat;
    nx52, ny52, nz52: GLfloat;
    nx53, ny53, nz53: GLfloat;
    nx54, ny54, nz54: GLfloat;
    nx55, ny55, nz55: GLfloat;
    nx56, ny56, nz56: GLfloat;
    nx57, ny57, nz57: GLfloat;
    nx58, ny58, nz58: GLfloat;
    nx59, ny59, nz59: GLfloat;
    nx60, ny60, nz60: GLfloat;
    nx61, ny61, nz61: GLfloat;
    nx62, ny62, nz62: GLfloat;
    nx63, ny63, nz63: GLfloat;
    nx64, ny64, nz64: GLfloat;
    nx65, ny65, nz65: GLfloat;
    nx66, ny66, nz66: GLfloat;
    nx67, ny67, nz67: GLfloat;
    nx68, ny68, nz68: GLfloat;
    nx69, ny69, nz69: GLfloat;
    nx70, ny70, nz70: GLfloat;

     //3
   nx71, ny71, nz71: GLfloat;
    nx72, ny72, nz72: GLfloat;
    nx73, ny73, nz73: GLfloat;
    nx74, ny74, nz74: GLfloat;
    nx75, ny75, nz75: GLfloat;
    nx76, ny76, nz76: GLfloat;
    nx77, ny77, nz77: GLfloat;
    nx78, ny78, nz78: GLfloat;
    nx79, ny79, nz79: GLfloat;
    nx80, ny80, nz80: GLfloat;
    nx81, ny81, nz81: GLfloat;
    nx82, ny82, nz82: GLfloat;
    nx83, ny83, nz83: GLfloat;
    nx84, ny84, nz84: GLfloat;
    nx85, ny85, nz85: GLfloat;
    nx86, ny86, nz86: GLfloat;
    nx87, ny87, nz87: GLfloat;
    nx88, ny88, nz88: GLfloat;
    nx89, ny89, nz89: GLfloat;
    nx90, ny90, nz90: GLfloat;
    nx91, ny91, nz91: GLfloat;
    nx92, ny92, nz92: GLfloat;
    nx93, ny93, nz93: GLfloat;
    nx94, ny94, nz94: GLfloat;
    nx95, ny95, nz95: GLfloat;
    nx96, ny96, nz96: GLfloat;
    nx97, ny97, nz97: GLfloat;
    nx98, ny98, nz98: GLfloat;
    nx99, ny99, nz99: GLfloat;
    nx100, ny100, nz100: GLfloat;
    nx101, ny101, nz101: GLfloat;
    nx102, ny102, nz102: GLfloat;
    nx103, ny103, nz103: GLfloat;
    nx104, ny104, nz104: GLfloat;
     nx105, ny105, nz105: GLfloat;
     //
     nx106, ny106, nz106: GLfloat;
     nx107, ny107, nz107: GLfloat;
     nx108, ny108, nz108: GLfloat;
     nx109, ny109, nz109: GLfloat;
     nx110, ny110, nz110: GLfloat;
     nx111, ny111, nz111: GLfloat;
     nx112, ny112, nz112: GLfloat;
     nx113, ny113, nz113: GLfloat;
     nx114, ny114, nz114: GLfloat;
     nx115, ny115, nz115: GLfloat;
     nx116, ny116, nz116: GLfloat;
     nx117, ny117, nz117: GLfloat;
     nx118, ny118, nz118: GLfloat;
     nx119, ny119, nz119: GLfloat;
     nx120, ny120, nz120: GLfloat;
     nx121, ny121, nz121: GLfloat;
     nx122, ny122, nz122: GLfloat;
     nx123, ny123, nz123: GLfloat;
     nx124, ny124, nz124: GLfloat;
     nx125, ny125, nz125: GLfloat;
     nx126, ny126, nz126: GLfloat;
     nx127, ny127, nz127: GLfloat;
     nx128, ny128, nz128: GLfloat;
     nx129, ny129, nz129: GLfloat;
     nx130, ny130, nz130: GLfloat;
     nx131, ny131, nz131: GLfloat;
     nx132, ny132, nz132: GLfloat;
     nx133, ny133, nz133: GLfloat;
     nx134, ny134, nz134: GLfloat;
     nx135, ny135, nz135: GLfloat;
     nx136, ny136, nz136: GLfloat;
     nx137, ny137, nz137: GLfloat;
     nx138, ny138, nz138: GLfloat;
     nx139, ny139, nz139: GLfloat;
     nx140, ny140, nz140: GLfloat;
     nx141, ny141, nz141: GLfloat;
     nx142, ny142, nz142: GLfloat;
     nx143, ny143, nz143: GLfloat;
     nx144, ny144, nz144: GLfloat;
     nx145, ny145, nz145: GLfloat;
     nx146, ny146, nz146: GLfloat;
     nx147, ny147, nz147: GLfloat;
     nx148, ny148, nz148: GLfloat;
     nx149, ny149, nz149: GLfloat;
     nx150, ny150, nz150: GLfloat;
     nx151, ny151, nz151: GLfloat;
     nx152, ny152, nz152: GLfloat;
     nx153, ny153, nz153: GLfloat;
     nx154, ny154, nz154: GLfloat;
     nx155, ny155, nz155: GLfloat;
     nx156, ny156, nz156: GLfloat;
     nx157, ny157, nz157: GLfloat;
     nx158, ny158, nz158: GLfloat;
     nx159, ny159, nz159: GLfloat;
     nx160, ny160, nz160: GLfloat;
     nx161, ny161, nz161: GLfloat;
     nx162, ny162, nz162: GLfloat;
     nx163, ny163, nz163: GLfloat;
     nx164, ny164, nz164: GLfloat;
     nx165, ny165, nz165: GLfloat;
     nx166, ny166, nz166: GLfloat;
     nx167, ny167, nz167: GLfloat;
     nx168, ny168, nz168: GLfloat;
     nx169, ny169, nz169: GLfloat;
     nx170, ny170, nz170: GLfloat;
     nx171, ny171, nz171: GLfloat;
     nx172, ny172, nz172: GLfloat;
     nx173, ny173, nz173: GLfloat;
     nx174, ny174, nz174: GLfloat;
     nx175, ny175, nz175: GLfloat;
     nx176, ny176, nz176: GLfloat;
     nx177, ny177, nz177: GLfloat;
     nx178, ny178, nz178: GLfloat;
     nx179, ny179, nz179: GLfloat;
     nx180, ny180, nz180: GLfloat;
     nx181, ny181, nz181: GLfloat;
     nx182, ny182, nz182: GLfloat;
     nx183, ny183, nz183: GLfloat;
     nx184, ny184, nz184: GLfloat;
     nx185, ny185, nz185: GLfloat;
     nx186, ny186, nz186: GLfloat;
     nx187, ny187, nz187: GLfloat;
     nx188, ny188, nz188: GLfloat;
     nx189, ny189, nz189: GLfloat;
     nx190, ny190, nz190: GLfloat;
     nx191, ny191, nz191: GLfloat;
     nx192, ny192, nz192: GLfloat;
     nx193, ny193, nz193: GLfloat;
     nx194, ny194, nz194: GLfloat;
     nx195, ny195, nz195: GLfloat;
     nx196, ny196, nz196: GLfloat;
     nx197, ny197, nz197: GLfloat;
     nx198, ny198, nz198: GLfloat;
     nx199, ny199, nz199: GLfloat;
     nx200, ny200, nz200: GLfloat;
     nx201, ny201, nz201: GLfloat;
     nx202, ny202, nz202: GLfloat;
     nx203, ny203, nz203: GLfloat;
     nx204, ny204, nz204: GLfloat;
     nx205, ny205, nz205: GLfloat;
     nx206, ny206, nz206: GLfloat;
     nx207, ny207, nz207: GLfloat;
      nx208, ny208, nz208: GLfloat;
      nx209, ny209, nz209: GLfloat;
      nx210, ny210, nz210: GLfloat;
      nx211, ny211, nz211: GLfloat;
      nx212, ny212, nz212: GLfloat;
      nx213, ny213, nz213: GLfloat;
      nx214, ny214, nz214: GLfloat;
      nx215, ny215, nz215: GLfloat;
      nx216, ny216, nz216: GLfloat;
      nx217, ny217, nz217: GLfloat;
      nx218, ny218, nz218: GLfloat;
implementation

{$R *.DFM}

uses Unit1, Unit2;

{=======================================================================
Инициализация}
procedure TfrmGL.Init;
begin
 glEnable(GL_DEPTH_TEST);
 glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
 glEnable (GL_COLOR_MATERIAL);
 // Включить преобразование нормалей
 // при масштабировании
 glEnable (GL_NORMALIZE);
 glColor3f (0.4, 0.6, 0.6);
end;



procedure TfrmGL.l1Click(Sender: TObject);
begin
MyMesh3.Destroy; // Уничтожить предыдущий объект
MyMesh3 := TGLMultyMesh.Create;
  MyMesh3.LoadFromFile( 'vzriv/2.gms' );
  MyMesh3.Extent := true;  // Масштабировать
  MyMesh3.fSmooth := False; // Установить в фасеты
  if MyMesh3.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
end;

{=======================================================================


Перерисовка окна}

procedure TfrmGL.BmpTexture;
var
  i, j: Integer;
begin
   bitmap := TBitmap.Create;
   bitmap.LoadFromFile('1.bmp'); // загрузка текстуры из файла

   {--- заполнение битового массива ---}
    For i := 0 to 63 do
      For j := 0 to 63 do begin
        bits [i, j, 0] := GetRValue(bitmap.Canvas.Pixels[i,j]);
        bits [i, j, 1] := GetGValue(bitmap.Canvas.Pixels[i,j]);
        bits [i, j, 2] := GetBValue(bitmap.Canvas.Pixels[i,j]);
    end;

    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
                 64, 64,     // здесь задается размер текстуры
                 0, GL_RGB, GL_UNSIGNED_BYTE, @Bits);
    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
    glEnable(GL_TEXTURE_2D);
end;

procedure TfrmGL.BmpTexture1;
var
  i, j: Integer;
begin
   bitmap1 := TBitmap.Create;
   bitmap1.LoadFromFile('gold.bmp'); // загрузка текстуры из файла

   {--- заполнение битового массива ---}
    For i := 0 to 63 do
      For j := 0 to 63 do begin
        bits1 [i, j, 0] := GetRValue(bitmap1.Canvas.Pixels[i,j]);
        bits1 [i, j, 1] := GetGValue(bitmap1.Canvas.Pixels[i,j]);
        bits1 [i, j, 2] := GetBValue(bitmap1.Canvas.Pixels[i,j]);
    end;

    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
                 64, 64,     // здесь задается размер текстуры
                 0, GL_RGB, GL_UNSIGNED_BYTE, @Bits1);
    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
    glEnable(GL_TEXTURE_2D);
end;

procedure TfrmGL.WMPaint(var Msg: TWMPaint);
var
  ps: TPaintStruct;

begin
  BeginPaint(Handle, ps);
  glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
   glcolor(0.5,0.5,0.5) ;




   glPushMatrix;

 // glScale(StrToInt(Edit4.Text), StrToInt(Edit5.Text), StrToInt(Edit6.Text) );
  glTranslatef(1, ny1, 1 );
   if povorot=1 then
  begin
  glRotatef (2 *angle, 0.0,0.0 , 1.0);
  end;
    glRotatef (-90.0, 1.0, 0.0, 0.0);
    if povorot=1 then
  begin
  glRotatef (2 *135, 0.0,0.0 , 1.0);
  end;
   if povorot=2 then
  begin
  glRotatef (2 *270, 0.0,0.0 , 1.0);
  end;
   if povorot=3 then
  begin
  glRotatef (2 *225, 0.0,0.0 , 1.0);
  end;

MyMesh1.Draw; // Рисуем объект

   glPopMatrix;

  glcolor(0.0,0.0,1) ;

   glPushMatrix;
  //glScale(100, 1, 100 );
  glTranslatef(nx, ny, nz);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx2, ny2, nz2);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx3, ny3, nz3);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект



   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx7, ny7, nz7);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx8, ny8, nz8);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx9, ny9, nz9);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;      /////////////////   корабль
    glcolor(0.0,1,0) ;   ///////////////////
  //glScale(0.1, 1, 0.1 ); ////////////////////////
  if sluch=2 then
     begin
    ny10:=0.0;
     end;
  glTranslatef(nx10, ny10, nz10);    ////////////////////
    glRotatef (-90.0, 1.0, 0.0, 0.0);     //////////////////
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);   /////////////////
 ///////////////////////////////////////////////////
 ///////////////////////////////////////////
     if sluch=1 then
     begin
     MyMesh31.Draw; // Рисуем объект  p
     end;
     if sluch=2 then
     begin
     MyMesh32.Draw;
     end;

   glPopMatrix;

   glPushMatrix;
   glcolor(0.0,0.0,1) ;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx11, ny11, nz11);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx12, ny12, nz12);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;
 //////////////////////
   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx14, ny14, nz14);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx15, ny15, nz15);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

  glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx16, ny16, nz16);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

     glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx17, ny17, nz17);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx18, ny18, nz18);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx19, ny19, nz19);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx20, ny20, nz20);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);  ////////////////
                         //////////////////////////////
 ///////////////////////////////////

MyMesh3.Draw; // Рисуем объект  /////////корабль

   glPopMatrix;


     glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx21, ny21, nz21);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx22, ny22, nz22);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx23, ny23, nz23);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx24, ny24, nz24);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx25, ny25, nz25);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx26, ny26, nz26);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx27, ny27, nz27);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx28, ny28, nz28);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx29, ny29, nz29);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx30, ny30, nz30);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx31, ny31, nz31);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx32, ny32, nz32);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx33, ny33, nz33);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx34, ny34, nz34);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx35, ny35, nz35);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx36, ny36, nz36);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx37, ny37, nz37);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx38, ny38, nz38);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx39, ny39, nz39);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx40, ny40, nz40);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx41, ny41, nz41);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx42, ny42, nz42);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx43, ny43, nz43);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

  glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx44, ny44, nz44);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx45, ny45, nz45);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh30.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx44, ny44, nz44);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh29.Draw; // Рисуем объект

   glPopMatrix;





 glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx46, ny46, nz46);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);
                                        //подлодка


MyMesh28.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx47, ny47, nz47);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx48, ny48, nz48);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx49, ny49, nz49);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx50, ny50, nz50);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

 //////////////2
 ///
 ///
 ///
 ///
 ///  //////////////
   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx51, ny51, nz51);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;


   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx52, ny52, nz52);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;
  glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx53, ny53, nz53);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;


   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx54, ny54, nz54);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

     glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx55, ny55, nz55);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;




   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx56, ny56, nz56);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx57, ny57, nz57);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx58, ny58, nz58);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx59, ny59, nz59);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx60, ny60, nz60);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx61, ny61, nz61);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx62, ny62, nz62);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx63, ny63, nz63);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx64, ny64, nz64);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx65, ny65, nz65);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

     glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx66, ny66, nz66);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx67, ny67, nz67);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;


    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx68, ny68, nz68);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx69, ny69, nz69);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx70, ny70, nz70);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

//////////////2
 ///
 ///
 ///
 ///
 ///  //////////////
   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx71, ny71, nz71);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;


   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx72, ny72, nz72);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;
  glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx73, ny73, nz73);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;


   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx74, ny74, nz74);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

     glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx75, ny75, nz75);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;




   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx76, ny76, nz76);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx77, ny77, nz77);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx78, ny78, nz78);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx79, ny79, nz79);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx80, ny80, nz80);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx81, ny81, nz81);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx82, ny82, nz82);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx83, ny83, nz83);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx84, ny84, nz84);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx85, ny85, nz85);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

     glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx86, ny86, nz86);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx87, ny87, nz87);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;


    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx88, ny88, nz88);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx89, ny89, nz89);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx90, ny90, nz90);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

  glPushMatrix;
  //glScale(0.1, 1, 0.1 );
  glTranslatef(nx91, ny91, nz91);

  if povorot=0 then
  begin
   glRotatef (-90.0, 1.0, 0.0, 0.0);
 glRotatef (2 * 180, 0.0,0.0 , 1.0);
  end;

  if povorot=1 then
  begin
   glRotatef (-90.0, 1.0, 0.0, 0.0);
 glRotatef (2 * 135, 0.0,0.0 , 1.0);
  end;
   if povorot=2 then
  begin
  glRotatef (2 *270, 0.0,0.0 , 1.0);
  end;
   if povorot=3 then
  begin
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 *225, 0.0,0.0 , 1.0);
  end;
    //  glRotatef (-90.0, 1.0, 0.0, 0.0);
 // glRotatef (2 * 135, 0.0,0.0 , 1.0);



MyMesh5.Draw; // Рисуем объект

   glPopMatrix;

   if plamia=1 then
   begin
   glPushMatrix;
   glcolor(1.0,0.0,0.0);
  glScale(0.1, 1, 0.1 );
  glTranslatef(nx92, ny92, nz92);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);


                    // пламя

 //MyMesh6.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
   glcolor(0.6,0.6,0.0);
  glScale(0.1, 1, 0.1 );
  glTranslatef(nx93, ny93, nz93);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 10, 0.0,0.0 , 1.0);



//MyMesh6.Draw; // Рисуем объект

   glPopMatrix;
   end;

   ///цифры
glPushMatrix;
  glcolor(1.0,0.0,0.0);
  glTranslatef(nx94, ny94, nz94);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh10.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glcolor(0.0,1.0,0.0);
  glTranslatef(nx95, ny95, nz95);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh9.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glcolor(0.0,0.0,1.0);
  glTranslatef(nx96, ny96, nz96);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh8.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glcolor(1.0,0.0,1.0);
  glTranslatef(nx97, ny97, nz97);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh7.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glcolor(0.0,1.0,1.0);
  glTranslatef(nx98, ny98, nz98);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh11.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glcolor(1.0,1.0,0.0);
  glTranslatef(nx99, ny99, nz99);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh12.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glcolor(1.0,1.0,1.0);
  glTranslatef(nx100, ny100, nz100);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh13.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glcolor(1.0,1.0,0.5);
  glTranslatef(nx101, ny101, nz101);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh14.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glcolor(1.0,0.5,0.5);
  glTranslatef(nx102, ny102, nz102);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh15.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glcolor(0.5,0.5,0.5);
  glTranslatef(nx103, ny103, nz103);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh16.Draw; // Рисуем объект

   glPopMatrix;

   ///буквы
   ///
   ///
      glPushMatrix;
  glcolor(0.5,0.5,0.5);
  glTranslatef(nx104, ny104, nz104);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 45, 0.0,0.0 , 1.0);



MyMesh26.Draw; // Рисуем объект        //26-17

   glPopMatrix;

    glPushMatrix;
  glcolor(0.5,0.5,0.5);
  glTranslatef(nx105, ny105, nz105);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 45, 0.0,0.0 , 1.0);



MyMesh25.Draw; // Рисуем объект        //26-17

   glPopMatrix;

   glPushMatrix;
  glcolor(1,0.5,0.5);
  glTranslatef(nx106, ny106, nz106);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 45, 0.0,0.0 , 1.0);



MyMesh24.Draw; // Рисуем объект        //26-17

   glPopMatrix;

   glPushMatrix;
  glcolor(1,1,0.5);
  glTranslatef(nx107, ny107, nz107);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 45, 0.0,0.0 , 1.0);



MyMesh23.Draw; // Рисуем объект        //26-17

   glPopMatrix;

    glPushMatrix;
  glcolor(0.5,1,0.5);
  glTranslatef(nx108, ny108, nz108);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 45, 0.0,0.0 , 1.0);



MyMesh22.Draw; // Рисуем объект        //26-17

   glPopMatrix;

    glPushMatrix;
  glcolor(1,1,0.3);
  glTranslatef(nx109, ny109, nz109);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 45, 0.0,0.0 , 1.0);



MyMesh21.Draw; // Рисуем объект        //26-17

   glPopMatrix;

     glPushMatrix;
  glcolor(1,1,0.3);
  glTranslatef(nx110, ny110, nz110);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 45, 0.0,0.0 , 1.0);



MyMesh20.Draw; // Рисуем объект        //26-17

   glPopMatrix;

   glPushMatrix;
  glcolor(1,0.3,0.3);
  glTranslatef(nx111, ny111, nz111);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 45, 0.0,0.0 , 1.0);



MyMesh19.Draw; // Рисуем объект        //26-17

   glPopMatrix;

    glPushMatrix;
  glcolor(0.3,0.3,0.3);
  glTranslatef(nx112, ny112, nz112);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 45, 0.0,0.0 , 1.0);



MyMesh18.Draw; // Рисуем объект        //26-17

   glPopMatrix;

   glPushMatrix;
  glcolor(0.3,0.3,1);
  glTranslatef(nx113, ny113, nz113);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 45, 0.0,0.0 , 1.0);



MyMesh17.Draw; // Рисуем объект        //26-17

   glPopMatrix;

    glPushMatrix;
  glcolor(0.3,0.3,0.3);
  glTranslatef(nx114, ny114, nz114);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 45, 0.0,0.0 , 1.0);


  if sluch=1 then
  begin
  MyMesh32.Draw; // корабль
  end;
   if sluch=2 then
  begin
  MyMesh31.Draw; // корабль
  end;

   glPopMatrix;
/////////////////////////////////////////
///  /////////////////////////////////
///  //////////////////////////////////
///  /////////////////////////////////////
///  //////////////////////////////
///  /////////////////////////////
///  //////////////////////////////
///
///  ////////////////////////
///  ///////////////////
///  ///////////
///цифры
glPushMatrix;
  glcolor(1.0,0.0,0.0);
  glTranslatef(nx115, ny115, nz115);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh10.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glcolor(0.0,1.0,0.0);
  glTranslatef(nx116, ny116, nz116);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh9.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glcolor(0.0,0.0,1.0);
  glTranslatef(nx117, ny117, nz117);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh8.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glcolor(1.0,0.0,1.0);
  glTranslatef(nx118, ny118, nz118);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh7.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glcolor(0.0,1.0,1.0);
  glTranslatef(nx119, ny119, nz119);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh11.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glcolor(1.0,1.0,0.0);
  glTranslatef(nx120, ny120, nz120);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh12.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glcolor(1.0,1.0,1.0);
  glTranslatef(nx121, ny121, nz121);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh13.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glcolor(1.0,1.0,0.5);
  glTranslatef(nx122, ny122, nz122);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh14.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glcolor(1.0,0.5,0.5);
  glTranslatef(nx123, ny123, nz123);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh15.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glcolor(0.5,0.5,0.5);
  glTranslatef(nx124, ny124, nz124);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh16.Draw; // Рисуем объект

   glPopMatrix;
//////////////////////
///
///
///
///
///
///
   glPushMatrix;
  glcolor(0.0,0.0,1.0);
  glTranslatef(nx125, ny125, nz125);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

  glPushMatrix;
  glTranslatef(nx126, ny126, nz126);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

     glPushMatrix;
  glTranslatef(nx127, ny127, nz127);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx128, ny128, nz128);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glTranslatef(nx129, ny129, nz129);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glTranslatef(nx130, ny130, nz130);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx131, ny131, nz131);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx132, ny132, nz132);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx133, ny133, nz133);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx134, ny134, nz134);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx135, ny135, nz135);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx136, ny136, nz136);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx137, ny137, nz137);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx138, ny138, nz138);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx139, ny139, nz139);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx140, ny140, nz140);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx141, ny141, nz141);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx142, ny142, nz142);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx143, ny143, nz143);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx144, ny144, nz144);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx145, ny145, nz145);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

     glPushMatrix;
  glTranslatef(nx146, ny146, nz146);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx147, ny147, nz147);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;


   glPushMatrix;
  glTranslatef(nx148, ny148, nz148);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx149, ny149, nz149);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx150, ny150, nz150);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx151, ny151, nz151);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx152, ny152, nz152);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glTranslatef(nx153, ny153, nz153);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glTranslatef(nx154, ny154, nz154);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;
  glTranslatef(nx154, ny154, nz154);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;
  glTranslatef(nx155, ny155, nz155);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx156, ny156, nz156);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;


   glPushMatrix;

  glTranslatef(nx157, ny157, nz157);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx158, ny158, nz158);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

     glPushMatrix;

  glTranslatef(nx159, ny159, nz159);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

     glPushMatrix;

  glTranslatef(nx160, ny160, nz160);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

       glPushMatrix;
  glTranslatef(nx161, ny161, nz161);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

       glPushMatrix;
  glTranslatef(nx162, ny162, nz162);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

       glPushMatrix;
  glTranslatef(nx163, ny163, nz163);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

       glPushMatrix;

  glTranslatef(nx164, ny164, nz164);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx165, ny165, nz165);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx166, ny166, nz166);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx167, ny167, nz167);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx168, ny168, nz168);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx169, ny169, nz169);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx170, ny170, nz170);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx171, ny171, nz171);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx172, ny172, nz172);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx173, ny173, nz173);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx174, ny174, nz174);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx175, ny175, nz175);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx176, ny176, nz176);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx177, ny177, nz177);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx178, ny178, nz178);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx179, ny179, nz179);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx180, ny180, nz180);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx181, ny181, nz181);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx182, ny182, nz182);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx183, ny183, nz183);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx184, ny184, nz184);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx185, ny185, nz185);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx186, ny186, nz186);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx187, ny187, nz187);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx188, ny188, nz188);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx189, ny189, nz189);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx190, ny190, nz190);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx191, ny191, nz191);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx192, ny192, nz192);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx193, ny193, nz193);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx194, ny194, nz194);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx195, ny195, nz195);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

   glPushMatrix;

  glTranslatef(nx196, ny196, nz196);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx197, ny197, nz197);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx198, ny198, nz198);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx199, ny199, nz199);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx200, ny200, nz200);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx201, ny201, nz201);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx202, ny202, nz202);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx203, ny203, nz203);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

    glPushMatrix;

  glTranslatef(nx204, ny204, nz204);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh.Draw; // Рисуем объект

   glPopMatrix;

     glPushMatrix;
  glcolor(0.3,0.0,0.0);
  glTranslatef(nx205, ny205, nz205);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 90, 0.0,0.0 , 1.0);


    if sluch=1 then
    begin
  MyMesh33.Draw; // корабль
    end;
      if sluch=2 then
    begin
    MyMesh2.Draw; // корабль
    end;

   glPopMatrix;

    glPushMatrix;
  glcolor(0.3,0.0,0.0);
  glTranslatef(nx206, ny206, nz206);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 90, 0.0,0.0 , 1.0);


      if sluch=1 then
      begin
      MyMesh2.Draw; // подлодка
      end;


       if sluch=2 then
      begin
      MyMesh33.Draw; // подлодка
      end;
   glPopMatrix;

{     glPushMatrix;
  glcolor(0.3,0.0,0.0);
  glTranslatef(nx207, ny207, nz207);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 90, 0.0,0.0 , 1.0);



MyMesh27.Draw; // подлодка
   glPopMatrix;

     glPushMatrix;
  glcolor(0.3,0.0,0.0);
  glTranslatef(nx208, ny208, nz208);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 90, 0.0,0.0 , 1.0);



MyMesh27.Draw; // подлодка
   glPopMatrix;

   glPushMatrix;
  glcolor(0.3,0.0,0.0);
  glTranslatef(nx209, ny209, nz209);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 90, 0.0,0.0 , 1.0);



MyMesh27.Draw; // подлодка
   glPopMatrix;


   glPushMatrix;
  glcolor(0.3,0.0,0.0);
  glTranslatef(nx210, ny210, nz210);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 90, 0.0,0.0 , 1.0);



MyMesh27.Draw; // подлодка
   glPopMatrix;

     glPushMatrix;
  glcolor(0.3,0.0,0.0);
  glTranslatef(nx211, ny211, nz211);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 90, 0.0,0.0 , 1.0);



MyMesh27.Draw; // подлодка
   glPopMatrix;

     glPushMatrix;
  glcolor(0.3,0.0,0.0);
  glTranslatef(nx212, ny212, nz212);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 90, 0.0,0.0 , 1.0);



MyMesh27.Draw; // подлодка
   glPopMatrix;

   glPushMatrix;
  glcolor(0.3,0.0,0.0);
  glTranslatef(nx213, ny213, nz213);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 90, 0.0,0.0 , 1.0);



MyMesh27.Draw; // подлодка
   glPopMatrix;  }

   {glPushMatrix;
  glcolor(0.3,0.0,0.0);



  glTranslatef(nx214, ny214, nz214);
    glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * 45, 0.0,0.0 , 1.0);



MyMesh34.Draw; // Самолет
   glPopMatrix; }


   glcolor(1.0,0.0,0.0);
   glPushMatrix;

  glTranslatef(nx215, ny215, nz215);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh35.Draw; // Рисуем объект   корабль

   glPopMatrix;

   glcolor(0.0,1.0,0.0);
   glPushMatrix;

  glTranslatef(nx216, ny216, nz216);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh36.Draw; // Рисуем объект   корабль

   glPopMatrix;

     glPushMatrix;
     glcolor(0.0,1.0,0.0);
  glTranslatef(nx217, ny217, nz217);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh37.Draw; // Рисуем объект  подлодка

   glPopMatrix;

   {   glPushMatrix;
     glcolor(0.5,1.0,0.5);
  glTranslatef(nx218, ny218, nz218);
  glRotatef (-90.0, 1.0, 0.0, 0.0);
  glRotatef (2 * Angle, 0.0,0.0 , 1.0);



MyMesh38.Draw; // Рисуем объект  подлодка

   glPopMatrix;}


  SwapBuffers(DC);
  EndPaint(Handle, ps);


end;

{=======================================================================
Создание окна}
procedure TfrmGL.FormClick(Sender: TObject);
begin
{nx205 := 6.0;  //корабль
 ny205 := 0.0;
 nz205 := -4.0; }
Randomize();
Random(sluch);

 Edit1.Text:=FloatToStr(nx215);
 Edit3.Text:=FloatToStr(nz215); //if sluch=2 then
 Edit2.Text:=FloatToStr(sluch);

 if (nx205=11.0) and (nz205=1.0) then
 begin
 N161Click(Sender);
 ny:=ny-1;
 end;

{ nx114 := -6.0;  //корабль
 ny114 := 0.0;
 nz114 := -4.0; }
  if (nx114=-9.0) and (nz114=1.0) then
 begin
 N171Click(Sender);
  ny:=ny-1;
 end;

   if (nx20=0.0) and (nz20=1.0) then
 begin
 N111Click(Sender);
  ny:=ny-1;
 end;

 {   nx20 := -1.0;
 ny20 := 0.0;
 nz20 := -6.0; }  /// корабль
 ///
 // if (nx20=0.0) and (nz20=1.0) then
 //begin
 //N111Click(Sender);
 //end;

 { nx46 := -2.0;
 ny46 := -0.5;
 nz46 := -9.0;         /// подлодка
 }
 if (nx46=1.0) and (nz46=0.0) then
 begin
 N181Click(Sender);
  ny:=ny-1;
 end;


{nx44 := 2.0;
 ny44 := -0.5;
 nz44 := -8.0;}

 if (nx44=-1.0) and (nz44=1.0) then
 begin
 N191Click(Sender);
  ny:=ny-1;
 end;


{nx10 := -2.0;
 ny10 := -0.5;
 nz10 := -2.0;}
   if (nx10=-1.0) and (nz10=1.0) then
 begin
N211Click(Sender);
 ny:=ny-1;
 end;
 {nx206 := 6.0;  //Подлодка
 ny206 := -0.5;
 nz206 := -8.0; }

   if (nx206=1.0) and (nz206=-1.0) then
 begin
N151Click(Sender);
 ny:=ny-1;
 end;





 if (nx10=3) and (nz10=3) then
  begin
N211Click(Sender);
 ny:=ny-1;
 end;

 if (nx215=-1) and (nz215=1) then
  begin
N221Click(Sender);
 ny:=ny-1;
 end;





end;

procedure TfrmGL.FormCreate(Sender: TObject);
begin
x:=0;   plamia:=0;
sluch:=1;

stop:=0;
povorot:=1;
plamia:=0;
stop1:=0;stop2:=0; stop3:=0; stop4:=0; stop5:=0; stop6:=0; stop7:=0; stop8:=0;
chislo:=0;
num1:=0;num2:=0;num3:=0;num4:=0;num5:=0;num6:=0;num7:=0;num8:=0;num9:=0;
DC := GetDC(Handle);
  SetDCPixelFormat;
  hrc := wglCreateContext(DC);
  wglMakeCurrent(DC, hrc);
  glEnable(GL_DEPTH_TEST);// разрешаем тест глубины
  glEnable(GL_LIGHTING);  // разрешаем работу с освещенностью
  glEnable(GL_LIGHT0);    // включаем источник света 0
  shag:=0;
frmGL.Width:=800;

 nx := 0.0;
 ny := -0.5;
 nz := 0.0;
  nx1 := 0.0;
 ny1 := 0.0;
 nz1 := 0.0;
  nx2 := 0.0;
 ny2 := -0.5;
 nz2 := 1;

 nx3 := 0.0;
 ny3 := -0.5;
 nz3 := 1;


 nx7 := -1.0;
 ny7 :=  -0.5;
 nz7 := 0;

 nx8 := 1.0;
 ny8 := -0.5;
 nz8 := 2;

 nx9 := -1.0;
 ny9 := -0.5;
 nz9 := 2.0;

  nx10 := -2.0;
 ny10 := -0.5;
 nz10 := -2.0;     /////podlodka

 nx11 := 3.0;
 ny11 := -0.5;
 nz11 := -2.0;

 nx11 := -1.0;
 ny11 := -0.5;
 nz11 := -2.0;

 nx12 := 1.0;
 ny12 := -0.5;
 nz12 := -2.0;

 nx14 := 1.0;
 ny14 := -0.5;
 nz14 := -3.0;

 nx15 := -1.0;
 ny15 := -0.5;
 nz15 := -3.0;

 nx16 := -1.0;
 ny16 := -0.5;
 nz16 := -4.0;

 nx17 := 1.0;
 ny17 := -0.5;
 nz17 := -4.0;

  nx18 := -1.0;
 ny18 := -0.5;
 nz18 := -5.0;

 nx19 := 1.0;
 ny19 := -0.5;
 nz19 := -5.0;

  nx20 := -1.0;
 ny20 := 0.0;
 nz20 := -6.0;   /// корабль

 nx21 := -1.0;
 ny21 := -0.5;
 nz21 := -7.0;

 nx22 := 1.0;
 ny22 := -0.5;
 nz22 := -7.0;

  nx23 := -1.0;
 ny23 := -0.5;
 nz23 := -8.0;

 nx24 := 1.0;
 ny24 := -0.5;
 nz24 := -8.0;

  nx25 := 1.0;
 ny25 := -0.5;
 nz25 := -9.0;

 nx26 := -1.0;
 ny26 := -0.5;
 nz26 := -9.0;

 nx27 := 1.0;
 ny27 := -0.5;
 nz27 := -10.0;


  nx28 := -1.0;
 ny28 := -0.5;
 nz28 := -10.0;

  nx29 := 1.0;
 ny29 := -0.5;
 nz29 := -11.0;

 nx30 := -1.0;
 ny30 := -0.5;
 nz30 := -11.0;
// 1

 nx31 := -2.0;
 ny31 := -0.5;
 nz31 := -2.0;

 nx32 := 2.0;
 ny32 := -0.5;
 nz32 := -2.0;

 nx33 := -2.0;
 ny33 := -0.5;
 nz33 := -3.0;

 nx34 :=  2.0;
 ny34 := -0.5;
 nz34 := -3.0;

 nx35 := -2.0;
 ny35 := -0.5;
 nz35 := -4.0;

 nx36 := 2.0;
 ny36 := -0.5;
 nz36 := -4.0;

  nx37 := -2.0;
 ny37 := -0.5;
 nz37 := -5.0;

 nx38 := 2.0;
 ny38 := -0.5;
 nz38 := -5.0;

 nx39 := -2.0;
 ny39 := -0.5;
 nz39 := -6.0;

 nx40 := 2.0;
 ny40 := -0.5;
 nz40 := -6.0;

 nx41 := -2.0;
 ny41 := -0.5;
 nz41 := -7.0;

 nx42 := 2.0;
 ny42 := -0.5;
 nz42 := -7.0;

 nx43 := -2.0;
 ny43 := -0.5;
 nz43 := -8.0;

 nx44 := 2.0;
 ny44 := -0.5;
 nz44 := -8.0;

 nx45 := -2.0;  //////////////
 ny45 := -0.5;  ////////////////
 nz45 := -9.0;  //////////////

 //////////////////////

 nx46 := -2.0;
 ny46 := -0.5;
 nz46 := -9.0;


 nx47 := -2.0;
 ny47 := -0.5;
 nz47 := -9.0;

 nx48 := 2.0;
 ny48 := -0.5;
 nz48 := -10.0;

 nx49 := -2.0;
 ny49 := -0.5;
 nz49 := -11.0;

 nx50 := 2.0;
 ny50 := -0.5;
 nz50 := -11.0;

 ///2
 ///
 ///
 nx51 := -3.0;
 ny51 := -0.5;
 nz51 := -2.0;

 nx52 :=3.0;
 ny52 := -0.5;
 nz52 := -2.0;

 nx53 := -3.0;
 ny53 := -0.5;
 nz53 := -3.0;

 nx54 :=  3.0;
 ny54 := -0.5;
 nz54 := 3.0;

 nx55 := -3.0;
 ny55 := -0.5;
 nz55 := -3.0;

 nx56 := 3.0;
 ny56 := -0.5;
 nz56 := -4.0;

 nx57 := -3.0;
 ny57 := -0.5;
 nz57 := -5.0;

 nx58 := 3.0;
 ny58 := -0.5;
 nz58 := -5.0;

 nx59 := -3.0;
 ny59 := -0.5;
 nz59 := -6.0;

 nx60 := 3.0;
 ny60 := -0.5;
 nz60 := -6.0;

 nx61 := -3.0;
 ny61 := -0.5;
 nz61 := -7.0;

 nx62 := 3.0;
 ny62 := -0.5;
 nz62 := -7.0;

 nx63 := -3.0;
 ny63 := -0.5;
 nz63 := -8.0;

 nx64 := 3.0;
 ny64 := -0.5;
 nz64 := -8.0;

 nx65 := -3.0;
 ny65 := -0.5;
 nz65 := -9.0;

 nx66 := 3.0;
 ny66 := -0.5;
 nz66 := -9.0;


 nx67 := -3.0;
 ny67 := -0.5;
 nz67 := -10.0;

 nx68 := 3.0;
 ny68 := -0.5;
 nz68 := -10.0;

 nx69 := -3.0;
 ny69 := -0.5;
 nz69 := -11.0;

 nx70 := 3.0;
 ny70 := -0.5;
 nz70 := -11.0;

  ///3
 ///
 ///
 nx71 := -4.0;
 ny71 := -0.5;
 nz71 := -2.0;

 nx72 :=4.0;
 ny72 := -0.5;
 nz72 := -2.0;

 nx73 := -4.0;
 ny73 := -0.5;
 nz73 := -3.0;

 nx74 :=  4.0;
 ny74 := -0.5;
 nz74 := -3.0;

 nx75 := -4.0;
 ny75 := -0.5;
 nz75 := -4.0;

 nx76 := 4.0;
 ny76 := -0.5;
 nz76 := -4.0;

 nx77 := -4.0;
 ny77 := -0.5;
 nz77 := -5.0;

 nx78 := 4.0;
 ny78 := -0.5;
 nz78 := -5.0;

 nx79 := -4.0;
 ny79 := -0.5;
 nz79 := -6.0;

 nx80 := 4.0;
 ny80 := -0.5;
 nz80 := -6.0;

 nx81 := -4.0;
 ny81 := -0.5;
 nz81 := -7.0;

 nx82 := 4.0;
 ny82 := -0.5;
 nz82 := -7.0;

 nx83 := -4.0;
 ny83 := -0.5;
 nz83 := -8.0;

 nx84 := 4.0;
 ny84 := -0.5;
 nz84 := -8.0;

 nx85 := -4.0;
 ny85 := -0.5;
 nz85 := -9.0;

 nx86 := 4.0;
 ny86 := -0.5;
 nz86 := -9.0;


 nx87 := -4.0;
 ny87 := -0.5;
 nz87 := -10.0;

 nx88 := 4.0;
 ny88 := -0.5;
 nz88 := -10.0;

 nx89 := -4.0;
 ny89 := -0.5;
 nz89 := -11.0;

 nx90 := -2.0;
 ny90 := -0.5;
 nz90 := -2.0;

 nx91 := 1.3;  //торпеда
 ny91 := -0.5;
 nz91 := 0.4;

 nx92 := 2.7;  //пламя
 ny92 := 0.0;
 nz92 := -2.0;

 nx93 := 3.3;  //пламя
 ny93 := 0.0;
 nz93 := -2.0;

 nx94 := 0.0;  //цифры
 ny94 := 0.0;
 nz94 := 1.0;


 nx95 :=-2.0;  //цифры
 ny95 := 0.0;
 nz95 := 1.0;

 nx96 :=-4.0;  //цифры
 ny96 := 0.0;
 nz96 := 1.0;

 nx97 :=-6.0;  //цифры
 ny97 := 0.0;
 nz97 := 1.0;

 nx98 := 2.0;  //цифры
 ny98 := 0.0;
 nz98 := 1.0;

 nx99 := 4.0;  //цифры
 ny99 := 0.0;
 nz99 := 1.0;

 nx100 := 6.0;  //цифры
 ny100 := 0.0;
 nz100 := 1.0;

 nx101 := 8.0;  //цифры
 ny101 := 0.0;
 nz101 := 1.0;

 nx102 := 10.0;  //цифры
 ny102 := 0.0;
 nz102 := 1.0;

 nx103 := 12.0;  //цифры
 ny103 := 0.0;
 nz103 := 1.0;

  nx104 := -8.0;  //буквы
 ny104 := 0.0;
 nz104 := 0.0;

 nx105 := -8.0;  //буквы
 ny105 := 0.0;
 nz105 := -2.0;

  nx106 := -8.0;  //буквы
 ny106 := 0.0;
 nz106 := -4.0;

   nx107 := -8.0;  //буквы
 ny107 := 0.0;
 nz107 := -6.0;

  nx108 := -8.0;  //буквы
 ny108 := 0.0;
 nz108 := -8.0;

  nx109 := -8.0;  //буквы
 ny109 := 0.0;
 nz109 := -10.0;

 nx110 := -8.0;  //буквы
 ny110 := 0.0;
 nz110 := -12.0;

 nx111 := -8.0;  //буквы
 ny111 := 0.0;
 nz111 := -14.0;

  nx112 := -8.0;  //буквы
 ny112 := 0.0;
 nz112 := -16.0;

 nx113 := -8.0;  //буквы
 ny113 := 0.0;
 nz113 := -18.0;

 nx114 := -6.0;  //корабль
 ny114 := 0.0;
 nz114 := -4.0;

 nx115 := 0.0;  //цифры
 ny115 := 0.0;
 nz115 := -18.0;


 nx116 :=-2.0;  //цифры
 ny116 := 0.0;
 nz116 := -18.0;;

 nx117 :=-4.0;  //цифры
 ny117 := 0.0;
 nz117 := -18.0;;

 nx118 :=-6.0;  //цифры
 ny118 := 0.0;
 nz118 := -18.0;;

 nx119 := 2.0;  //цифры
 ny119 := 0.0;
 nz119 := -18.0;;

 nx120 := 4.0;  //цифры
 ny120 := 0.0;
 nz120 := -18.0;;

 nx121 := 6.0;  //цифры
 ny121 := 0.0;
 nz121 := -18.0;;

 nx122 := 8.0;  //цифры
 ny122 := 0.0;
 nz122 := -18.0;;

 nx123 := 10.0;  //цифры
 ny123 := 0.0;
 nz123 := -18.0;;

 nx124 := 12.0;  //цифры
 ny124 := 0.0;
 nz124 := -18.0;

 nx125 := 0.0;
 ny125 := -0.5;
 nz125 := -16.0;

 nx126 := 0.0;
 ny126 := -0.5;
 nz126 := -14.0;

 nx127 := 0.0;
 ny127 := -0.5;
 nz127 := -12.0;

 nx128 := 2.0;
 ny128 := -0.5;
 nz128 := -16.0;

 nx129 := -2.0;
 ny129 := -0.5;
 nz129 := -16.0;

 nx130 := -4.0;
 ny130 := -0.5;
 nz130 := -16.0;

 nx131 := 4.0;
 ny131 := -0.5;
 nz131 := -16.0;

 nx132 := -6.0;
 ny132 := -0.5;
 nz132 := -16.0;

 nx133 := 6.0;
 ny133 := -0.5;
 nz133 := -16.0;

  nx134 := 8.0;
 ny134 := -0.5;
 nz134 := -16.0;

 nx135 := -8.0;
 ny135 := -0.5;
 nz135 := -16.0;

 nx136 := -2.0;
 ny136 := -0.5;
 nz136 := -14.0;

 nx137 := 2.0;
 ny137 := -0.5;
 nz137 := -14.0;

 nx138 := -4.0;
 ny138 := -0.5;
 nz138 := -14.0;

 nx139 := 4.0;
 ny139 := -0.5;
 nz139 := -14.0;

 nx140 := -2.0;
 ny140 := -0.5;
 nz140 := -14.0;

 nx141 := 2.0;
 ny141 := -0.5;
 nz141 := -14.0;

 nx142 := 0.0;
 ny142 := -0.5;
 nz142 := -15.0;

 nx143 := 2.0;
 ny143 := -0.5;
 nz143 := -15.0;

 nx144 := -2.0;
 ny144 := -0.5;
 nz144 := -15.0;

 nx145 := -4.0;
 ny145 := -0.5;
 nz145 := -15.0;

 nx146 := 4.0;
 ny146 := -0.5;
 nz146 := -15.0;

 nx147 := 6.0;
 ny147 := -0.5;
 nz147 := -15.0;

 nx148 := -6.0;
 ny148 := -0.5;
 nz148 := -15.0;

 nx149 := -6.0;
 ny149 := -0.5;
 nz149 := -14.0;

 nx150 := 6.0;
 ny150 := -0.5;
 nz150 := -14.0;

  nx151 := 2.0;
 ny151 := -0.5;
 nz151 := -12.0;

 nx152 := -2.0;
 ny152 := -0.5;
 nz152 := -12.0;

 nx153 := 2.0;
 ny153 := -0.5;
 nz153 := -13.0;

 nx154 := -2.0;
 ny154 := -0.5;
 nz154 := -13.0;

  nx155 := 0.0;
 ny155 := -0.5;
 nz155 := -13.0;

   nx156 := 0.0;
 ny156 := -0.5;
 nz156 := -6.0;

 nx157 := 4.0;
 ny157 := -0.5;
 nz157 := -12.0;

 nx158 := -4.0;
 ny158 := -0.5;
 nz158 := -12.0;

 nx159 := -6.0;
 ny159 := -0.5;
 nz159 := -12.0;

 nx160 := 6.0;
 ny160 := -0.5;
 nz160 := -12.0;

  nx161 := 4.0;
 ny161 := -0.5;
 nz161 := -10.0;

 nx162 := -4.0;
 ny162 := -0.5;
 nz162 := -10.0;

 nx163 := -6.0;
 ny163 := -0.5;
 nz163 := -10.0;

 nx164 := 6.0;
 ny164 := -0.5;
 nz164 := -10.0;

 nx165 := 4.0;
 ny165 := -0.5;
 nz165 := -8.0;

 nx166 := -4.0;
 ny166 := -0.5;
 nz166 := -8.0;

 nx167 := -6.0;
 ny167 := -0.5;
 nz167 := -8.0;

 nx168 := 6.0;
 ny168 := -0.5;
 nz168 := -8.0;

  nx169 := 4.0;
 ny169 := -0.5;
 nz169 := -6.0;

 nx170 := -4.0;
 ny170 := -0.5;
 nz170 := -6.0;

 nx171 := -6.0;
 ny171 := -0.5;
 nz171 := -6.0;

 nx172 := 6.0;
 ny172 := -0.5;
 nz172 := -6.0;

  nx173 := 4.0;
 ny173 := -0.5;
 nz173 := -4.0;

 nx174 := -4.0;
 ny174 := -0.5;
 nz174 := -4.0;

 nx175 := -6.0;
 ny175 := -0.5;
 nz175 := -4.0;

 nx176 := 6.0;
 ny176 := -0.5;
 nz176 := -4.0;

  nx177 := 4.0;
 ny177 := -0.5;
 nz177 := -2.0;

 nx178 := -4.0;
 ny178 := -0.5;
 nz178 := -2.0;

 nx179 := -6.0;
 ny179 := -0.5;
 nz179 := -2.0;

 nx180 := 6.0;
 ny180 := -0.5;
 nz180 := -2.0;

 nx181 := 4.0;
 ny181 := -0.5;
 nz181 := -3.0;

 nx182 := -4.0;
 ny182 := -0.5;
 nz182 := -3.0;

 nx183 := -6.0;
 ny183 := -0.5;
 nz183 := -3.0;

 nx184 := 6.0;
 ny184 := -0.5;
 nz184 := -3.0;

  nx185 := 4.0;
 ny185 := -0.5;
 nz185 := -5.0;

 nx186 := -4.0;
 ny186 := -0.5;
 nz186 := -5.0;

 nx187 := -6.0;
 ny187 := -0.5;
 nz187 := -5.0;

 nx188 := 6.0;
 ny188 := -0.5;
 nz188 := -5.0;

 nx189 := -4.0;
 ny189 := -0.5;
 nz189 := -7.0;

 nx190 := 4.0;
 ny190 := -0.5;
 nz190 := -7.0;

 nx191 := -6.0;
 ny191 := -0.5;
 nz191 := -7.0;

 nx192 := 6.0;
 ny192 := -0.5;
 nz192 := -7.0;

  nx193 := -4.0;
 ny193 := -0.5;
 nz193 := -9.0;

 nx194 := 4.0;
 ny194 := -0.5;
 nz194 := -9.0;

 nx195 := -6.0;
 ny195 := -0.5;
 nz195 := -9.0;

 nx196 := 6.0;
 ny196 := -0.5;
 nz196 := -9.0;

  nx197 := -4.0;
 ny197 := -0.5;
 nz197 := -11.0;

 nx198 := 4.0;
 ny198 := -0.5;
 nz198 := -11.0;

 nx199 := -6.0;
 ny199 := -0.5;
 nz199 := -11.0;

 nx200 := 6.0;
 ny200 := -0.5;
 nz200 := -11.0;

  nx201 := -4.0;
 ny201 := -0.5;
 nz201 := -13.0;

 nx202 := 4.0;
 ny202 := -0.5;
 nz202 := -13.0;

 nx203 := -6.0;
 ny203 := -0.5;
 nz203 := -13.0;

 nx204 := 6.0;
 ny204 := -0.5;
 nz204 := -13.0;

 nx205 := 6.0;  //корабль
 ny205 := 0.0;
 nz205 := -4.0;

 nx206 := 6.0;  //Подлодка
 ny206 := -0.5;
 nz206 := -8.0;

 nx207 := 0.0;  //    Рамка
 ny207 := -0.5;
 nz207 := -2.0;

 nx208 := -2.0;  //    Рамка
 ny208 := -0.5;
 nz208 := -2.0;

 nx209 := -4.0;  //    Рамка
 ny209 := -0.5;
 nz209 := -2.0;

 nx210 := -6.0;  //    Рамка
 ny210 := -0.5;
 nz210 := -2.0;

 nx211 := 2.0;  //    Рамка
 ny211 := -0.5;
 nz211 := -2.0;

 nx212 := 4.0;  //    Рамка
 ny212 := -0.5;
 nz212 := -2.0;

  nx213 := 6.0;  //    Рамка
 ny213 := -0.5;
 nz213 := -2.0;

 nx214 := 0.0;
 ny214 := 0.0;
 nz214 := 0.0;

 nx215 := -6.0;  //Корабль
 ny215 := 0.0;
 nz215 := -12.0;

 nx216 := -4.0;  //Корабль
 ny216 := 0.0;
 nz216 := -10.0;

 nx217 := 4.0;  //Подлодка
 ny217 := -0.5;
 nz217 := -12.0;

 {nx218 := 0.0;  //Корабль
 ny218 := 0.0;
 nz218 := -10.0; }

  DC := GetDC(Handle);
  SetDCPixelFormat;
  hrc := wglCreateContext(DC);
  //wglMakeCurrent(DC, hrc);  //  не работает текстура если включена
  glClearColor (1.0, 0.5, 0.5, 1.0);
  down := 0;
  Init;
  MyMesh := TGLMultyMesh.Create;
  MyMesh.LoadFromFile( 'm.gms' );
  MyMesh.Extent := true;  // Масштабировать
  MyMesh.fSmooth := False; // Установить в фасеты
  /////// k
   MyMesh1 := TGLMultyMesh.Create;
  MyMesh1.LoadFromFile( 'k1.gms' );
  MyMesh1.Extent := true;  // Масштабировать
  MyMesh1.fSmooth := False; // Установить в фасеты

  ////// o
  MyMesh2 := TGLMultyMesh.Create;
  MyMesh2.LoadFromFile( 'p1.gms' ); // подлодка
  MyMesh2.Extent := true;  // Масштабировать
  MyMesh2.fSmooth := False; // Установить в фасеты
   ////// o

  MyMesh3 := TGLMultyMesh.Create;
  MyMesh3.LoadFromFile( 'ko/2.gms' );
  MyMesh3.Extent := true;  // Масштабировать
  MyMesh3.fSmooth := False; // Установить в фасеты

  MyMesh4 := TGLMultyMesh.Create;
  MyMesh4.LoadFromFile( 'm.gms' );
  MyMesh4.Extent := true;  // Масштабировать
  MyMesh4.fSmooth := False; // Установить в фасеты

  MyMesh5 := TGLMultyMesh.Create;
  MyMesh5.LoadFromFile( 'to/1.gms' );
  MyMesh5.Extent := true;  // Масштабировать
  MyMesh5.fSmooth := False; // Установить в фасеты


  MyMesh6 := TGLMultyMesh.Create;
  MyMesh6.LoadFromFile( 'o/1.gms' );
  MyMesh6.Extent := true;  // Масштабировать
  MyMesh6.fSmooth := False; // Установить в фасеты
 // if MyMesh.Meshes.Count <= 1 then N2.Enabled := False
 // else N2.Enabled := True;
       //цифры
   MyMesh7 := TGLMultyMesh.Create;
  MyMesh7.LoadFromFile( 'cifri/11.gms' );
  MyMesh7.Extent := true;  // Масштабировать
  MyMesh7.fSmooth := False; // Установить в фасеты

   MyMesh8 := TGLMultyMesh.Create;
  MyMesh8.LoadFromFile( 'cifri/12.gms' );
  MyMesh8.Extent := true;  // Масштабировать
  MyMesh8.fSmooth := False; // Установить в фасеты

   MyMesh9 := TGLMultyMesh.Create;
  MyMesh9.LoadFromFile( 'cifri/13.gms' );
  MyMesh9.Extent := true;  // Масштабировать
  MyMesh9.fSmooth := False; // Установить в фасеты

  MyMesh10 := TGLMultyMesh.Create;
  MyMesh10.LoadFromFile( 'cifri/14.gms' );
  MyMesh10.Extent := true;  // Масштабировать
  MyMesh10.fSmooth := False; // Установить в фасеты

  MyMesh11 := TGLMultyMesh.Create;
  MyMesh11.LoadFromFile( 'cifri/15.gms' );
  MyMesh11.Extent := true;  // Масштабировать
  MyMesh11.fSmooth := False; // Установить в фасеты

  MyMesh12 := TGLMultyMesh.Create;
  MyMesh12.LoadFromFile( 'cifri/16.gms' );
  MyMesh12.Extent := true;  // Масштабировать
  MyMesh12.fSmooth := False; // Установить в фасеты

  MyMesh13 := TGLMultyMesh.Create;
  MyMesh13.LoadFromFile( 'cifri/17.gms' );
  MyMesh13.Extent := true;  // Масштабировать
  MyMesh13.fSmooth := False; // Установить в фасеты

  MyMesh14 := TGLMultyMesh.Create;
  MyMesh14.LoadFromFile( 'cifri/18.gms' );
  MyMesh14.Extent := true;  // Масштабировать
  MyMesh14.fSmooth := False; // Установить в фасеты

   MyMesh15 := TGLMultyMesh.Create;
  MyMesh15.LoadFromFile( 'cifri/19.gms' );
  MyMesh15.Extent := true;  // Масштабировать
  MyMesh15.fSmooth := False; // Установить в фасеты

  MyMesh16 := TGLMultyMesh.Create;
  MyMesh16.LoadFromFile( 'cifri/20.gms' );
  MyMesh16.Extent := true;  // Масштабировать
  MyMesh16.fSmooth := False; // Установить в фасеты
///
///
///буквы
///
///
  MyMesh17 := TGLMultyMesh.Create;
  MyMesh17.LoadFromFile( 'cifri/21.gms' );
  MyMesh17.Extent := true;  // Масштабировать
  MyMesh17.fSmooth := False; // Установить в фасеты

   MyMesh18 := TGLMultyMesh.Create;
  MyMesh18.LoadFromFile( 'cifri/22.gms' );
  MyMesh18.Extent := true;  // Масштабировать
  MyMesh18.fSmooth := False; // Установить в фасеты

   MyMesh19 := TGLMultyMesh.Create;
  MyMesh19.LoadFromFile( 'cifri/23.gms' );
  MyMesh19.Extent := true;  // Масштабировать
  MyMesh19.fSmooth := False; // Установить в фасеты

   MyMesh20 := TGLMultyMesh.Create;
  MyMesh20.LoadFromFile( 'cifri/34.gms' );
  MyMesh20.Extent := true;  // Масштабировать
  MyMesh20.fSmooth := False; // Установить в фасеты

  MyMesh21 := TGLMultyMesh.Create;
  MyMesh21.LoadFromFile( 'cifri/24.gms' );
  MyMesh21.Extent := true;  // Масштабировать
  MyMesh21.fSmooth := False; // Установить в фасеты

  MyMesh22 := TGLMultyMesh.Create;
  MyMesh22.LoadFromFile( 'cifri/25.gms' );
  MyMesh22.Extent := true;  // Масштабировать
  MyMesh22.fSmooth := False; // Установить в фасеты

  MyMesh23 := TGLMultyMesh.Create;
  MyMesh23.LoadFromFile( 'cifri/26.gms' );
  MyMesh23.Extent := true;  // Масштабировать
  MyMesh23.fSmooth := False; // Установить в фасеты

  MyMesh24 := TGLMultyMesh.Create;
  MyMesh24.LoadFromFile( 'cifri/27.gms' );
  MyMesh24.Extent := true;  // Масштабировать
  MyMesh24.fSmooth := False; // Установить в фасеты

  MyMesh25 := TGLMultyMesh.Create;
  MyMesh25.LoadFromFile( 'cifri/28.gms' );
  MyMesh25.Extent := true;  // Масштабировать
  MyMesh25.fSmooth := False; // Установить в фасеты

  MyMesh26 := TGLMultyMesh.Create;
  MyMesh26.LoadFromFile( 'cifri/29.gms' );
  MyMesh26.Extent := true;  // Масштабировать
  MyMesh26.fSmooth := False; // Установить в фасеты

  MyMesh27 := TGLMultyMesh.Create;
  MyMesh27.LoadFromFile( 'ramka/1.gms' );
  MyMesh27.Extent := true;  // Масштабировать
  MyMesh27.fSmooth := False; // Установить в фасеты

  MyMesh28 := TGLMultyMesh.Create;
  MyMesh28.LoadFromFile( 'p1.gms' );
  MyMesh28.Extent := true;  // Масштабировать
  MyMesh28.fSmooth := False; // Установить в фасеты


  MyMesh29 := TGLMultyMesh.Create;
  MyMesh29.LoadFromFile( 'p1.gms' );
  MyMesh29.Extent := true;  // Масштабировать
  MyMesh29.fSmooth := False; // Установить в фасеты

  MyMesh30 := TGLMultyMesh.Create;
  MyMesh30.LoadFromFile( 'p1.gms' );
  MyMesh30.Extent := true;  // Масштабировать
  MyMesh30.fSmooth := False; // Установить в фасеты

  MyMesh31 := TGLMultyMesh.Create;
  MyMesh31.LoadFromFile( 'p1.gms' );
  MyMesh31.Extent := true;  // Масштабировать
  MyMesh31.fSmooth := False; // Установить в фасеты

  MyMesh32 := TGLMultyMesh.Create;
  MyMesh32.LoadFromFile( 'ko/2.gms' );//корабль
  MyMesh32.Extent := true;  // Масштабировать
  MyMesh32.fSmooth := False; // Установить в фасеты


  MyMesh33 := TGLMultyMesh.Create;
  MyMesh33.LoadFromFile( 'ko/2.gms' ); //корабль
  MyMesh33.Extent := true;  // Масштабировать
  MyMesh33.fSmooth := False; // Установить в фасеты

  MyMesh34 := TGLMultyMesh.Create;
  MyMesh34.LoadFromFile( 'samolet/1.gms' ); //корабль
  MyMesh34.Extent := true;  // Масштабировать
  MyMesh34.fSmooth := False; // Установить в фасеты

  MyMesh35 := TGLMultyMesh.Create;
  MyMesh35.LoadFromFile( 'ko/2.gms' ); //корабль
  MyMesh35.Extent := true;  // Масштабировать
  MyMesh35.fSmooth := False; // Установить в фасеты

  MyMesh36 := TGLMultyMesh.Create;
  MyMesh36.LoadFromFile( 'ko/2.gms' ); //корабль
  MyMesh36.Extent := true;  // Масштабировать
  MyMesh36.fSmooth := False; // Установить в фасеты

  MyMesh37 := TGLMultyMesh.Create;
  MyMesh37.LoadFromFile( 'p1.gms' ); // подлодка
  MyMesh37.Extent := true;  // Масштабировать
  MyMesh37.fSmooth := False; // Установить в фасеты


  MyMesh38 := TGLMultyMesh.Create;
  MyMesh38.LoadFromFile( 'ko/2.gms' ); //корабль
  MyMesh38.Extent := true;  // Масштабировать
  MyMesh38.fSmooth := False; // Установить в фасеты

end;

{=======================================================================
Изменение размеров окна}
procedure TfrmGL.FormResize(Sender: TObject);
begin
glViewport(0, 0, ClientWidth, ClientHeight);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity;
  gluPerspective(30.0, ClientWidth / ClientHeight, 1.0, 9.0);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity;
  glTranslatef(0.0, 0.0, -8.0);
  glRotatef(30.0, 1.0, 0.0, 0.0);
end;

{=======================================================================
Конец работы программы}
procedure TfrmGL.FormDestroy(Sender: TObject);
begin
 wglMakeCurrent(0, 0);
 wglDeleteContext(hrc);
 ReleaseDC(Handle, DC);
 DeleteDC (DC);
end;

{=======================================================================
Обработка нажатия клавиши}
procedure TfrmGL.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);

begin

  /////////
  /////////
  If Key = VK_SPACE then begin
  if povorot=1 then
  begin
  for i :=0 to 5 do
  begin


   nz91 := nz91 - 0.1;
   sleep(100);
   nz91 := nz91 - 0.1;
  end;

   plamia:=1;
  end;
  if povorot=0 then
  begin
   nx91 := nx91 - 0.1;
  end;
  if povorot=2 then
  begin
   nx91 := nx91 + 0.1;
  end;
  if povorot=3 then
  begin
   nz91 := nz91 + 0.1;
  end;

  if nz91>=nz11 then
  begin
  plamia:=1;
  end;
       
   InvalidateRect(Handle, nil, False);
 end;
    If Key = VK_LEFT then begin
    If ssShift in Shift
       then
       begin
       povorot:=2;
       nx1 := nx1 - 0.1;

       end
       else
        begin
        povorot:=0;
       nx1 := nx1 + 0.1;

   InvalidateRect(Handle, nil, False);
        end;
 end;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx2 := nx2 - 0.1
       else nx2 := nx2 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx3 := nx3 - 0.1
       else nx3 := nx3 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx7 := nx7 - 0.1
       else nx7 := nx7 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx8 := nx8 - 0.1
       else nx8 := nx8 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;
       If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx9 := nx9 - 0.1
       else nx9 := nx9 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

      If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx10 := nx10 - 0.1
       else nx10 := nx10 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

     If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx11 := nx11 - 0.1
       else nx11 := nx11 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;
     If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx12 := nx12 - 0.1
       else nx12 := nx12 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

     If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx13 := nx13 - 0.1
       else nx13 := nx13 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

    If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx14 := nx14 - 0.1
       else nx14 := nx14 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx15 := nx15 - 0.1
       else nx15 := nx15 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx16 := nx16 - 0.1
       else nx16 := nx16 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx17 := nx17 - 0.1
       else nx17 := nx17 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx18 := nx18 - 0.1
       else nx18 := nx18 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx19 := nx19 - 0.1
       else nx19 := nx19 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx20 := nx20 - 0.1
       else nx20 := nx20 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx21 := nx21 - 0.1
       else nx21 := nx21 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx22 := nx22 - 0.1
       else nx22 := nx22 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx23 := nx23 - 0.1
       else nx23 := nx23 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx24 := nx24 - 0.1
       else nx24 := nx24 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx25 := nx25 - 0.1
       else nx25 := nx25 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx26 := nx26- 0.1
       else nx26:= nx26+ 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx27 := nx27 - 0.1
       else nx27 := nx27 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx28 := nx28 - 0.1
       else nx28 := nx28 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx29 := nx29 - 0.1
       else nx29 := nx29 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx30 := nx30 - 0.1
       else nx30 := nx30 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx31 := nx31 - 0.1
       else nx31 := nx31 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx32 := nx32 - 0.1
       else nx32 := nx32 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx33 := nx33 - 0.1
       else nx33 := nx33 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx34 := nx34 - 0.1
       else nx34 := nx34 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx35 := nx35 - 0.1
       else nx35 := nx35 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx36 := nx36 - 0.1
       else nx36 := nx36 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx37 := nx37 - 0.1
       else nx37 := nx37 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx38 := nx38 - 0.1
       else nx38 := nx38 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx39 := nx39 - 0.1
       else nx39 := nx39 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx40 := nx40 - 0.1
       else nx40 := nx40 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx41 := nx41 - 0.1
       else nx41 := nx41 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx42 := nx42 - 0.1
       else nx42 := nx42 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx43 := nx43 - 0.1
       else nx43 := nx43 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx44 := nx44 - 0.1
       else nx44 := nx44 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx45 := nx45 - 0.1
       else nx45 := nx45 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx46 := nx46 - 0.1
       else nx46 := nx46 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx47 := nx47 - 0.1
       else nx47 := nx47 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx48 := nx48 - 0.1
       else nx48 := nx48 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx49 := nx49 - 0.1
       else nx49 := nx49 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx50 := nx50 - 0.1
       else nx50 := nx50 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx51 := nx51 - 0.1
       else nx51 := nx51 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx52 := nx52 - 0.1
       else nx52 := nx52 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx53 := nx53 - 0.1
       else nx53 := nx53 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx54 := nx54 - 0.1
       else nx54 := nx54 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx55 := nx55 - 0.1
       else nx55 := nx55 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx56 := nx56 - 0.1
       else nx56 := nx56 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx57 := nx57 - 0.1
       else nx57 := nx57 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx58 := nx58 - 0.1
       else nx58 := nx58 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx59 := nx59 - 0.1
       else nx59 := nx59 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx60 := nx60 - 0.1
       else nx60 := nx60 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx61 := nx61 - 0.1
       else nx61 := nx61 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx62 := nx62 - 0.1
       else nx62 := nx62 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx63 := nx63 - 0.1
       else nx63 := nx63 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx64 := nx64 - 0.1
       else nx64 := nx64 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

    If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx65 := nx65 - 0.1
       else nx65 := nx65 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx66 := nx66 - 0.1
       else nx66 := nx66 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx67 := nx67 - 0.1
       else nx67 := nx67 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx68 := nx68 - 0.1
       else nx68 := nx68 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx69 := nx69 - 0.1
       else nx69 := nx69 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx70 := nx70 - 0.1
       else nx70:= nx70 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;




  ///


  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx92 := nx92 - 0.1
       else nx92:= nx92 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx93 := nx93 - 0.1
       else nx93:= nx93 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx94 := nx94 - 0.1
       else nx94:= nx94 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx95 := nx95 - 0.1
       else nx95:= nx95 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx96 := nx96 - 0.1
       else nx96:= nx96 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx97 := nx97 - 0.1
       else nx97:= nx97 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx98 := nx98 - 0.1
       else nx98:= nx98 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx99 := nx99 - 0.1
       else nx99:= nx99 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx100 := nx100 - 0.1
       else nx100:= nx100 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx101 := nx101 - 0.1
       else nx101:= nx101 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx102 := nx102 - 0.1
       else nx102:= nx102 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx103 := nx103 - 0.1
       else nx103:= nx103 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx104 := nx104 - 0.1
       else nx104:= nx104 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx105 := nx105 - 0.1
       else nx105:= nx105 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx106 := nx106 - 0.1
       else nx106:= nx106 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx107 := nx107 - 0.1
       else nx107:= nx107 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx108 := nx108 - 0.1
       else nx108:= nx108 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx109 := nx109 - 0.1
       else nx109:= nx109 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx110 := nx110 - 0.1
       else nx110:= nx110 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx111 := nx111 - 0.1
       else nx111:= nx111 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx112 := nx112 - 0.1
       else nx112:= nx112 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx113 := nx113 - 0.1
       else nx113:= nx113 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx114 := nx114 - 0.1
       else nx114:= nx114 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx115 := nx115 - 0.1
       else nx115:= nx115 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx116 := nx116 - 0.1
       else nx116:= nx116 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx117 := nx117 - 0.1
       else nx117:= nx117 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx118 := nx118 - 0.1
       else nx118:= nx118 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;


 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx119 := nx119 - 0.1
       else nx119:= nx119 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;


 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx120 := nx120 - 0.1
       else nx120:= nx120 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx121 := nx121 - 0.1
       else nx121:= nx121 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx122 := nx122 - 0.1
       else nx122:= nx122 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx123 := nx123 - 0.1
       else nx123:= nx123 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx124 := nx124 - 0.1
       else nx124:= nx124 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx125 := nx125 - 0.1
       else nx125:= nx125 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx126 := nx126 - 0.1
       else nx126:= nx126 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx127 := nx127 - 0.1
       else nx127:= nx127 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx128 := nx128 - 0.1
       else nx128:= nx128 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx129 := nx129 - 0.1
       else nx129:= nx129 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx130 := nx130 - 0.1
       else nx130:= nx130 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx131 := nx131 - 0.1
       else nx131:= nx131 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx132 := nx132 - 0.1
       else nx132:= nx132 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx133 := nx133 - 0.1
       else nx133:= nx133 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx134 := nx134 - 0.1
       else nx134:= nx134 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx135 := nx135 - 0.1
       else nx135:= nx135 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx136 := nx136 - 0.1
       else nx136:= nx136 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx137 := nx137 - 0.1
       else nx137:= nx137 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx138 := nx138 - 0.1
       else nx138:= nx138 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx139 := nx139 - 0.1
       else nx139:= nx139 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx140 := nx140 - 0.1
       else nx140:= nx140 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx141 := nx141 - 0.1
       else nx141:= nx141 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx142 := nx142 - 0.1
       else nx142:= nx142 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx143 := nx143 - 0.1
       else nx143:= nx143 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx144 := nx144 - 0.1
       else nx144:= nx144 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx145 := nx145 - 0.1
       else nx145:= nx145 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx146 := nx146 - 0.1
       else nx146:= nx146 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx147 := nx147 - 0.1
       else nx147:= nx147 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx148 := nx148 - 0.1
       else nx148:= nx148 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx149 := nx149 - 0.1
       else nx149:= nx149 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx150 := nx150 - 0.1
       else nx150:= nx150 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx151 := nx151 - 0.1
       else nx151:= nx151 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx152 := nx152 - 0.1
       else nx152:= nx152 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx153 := nx153 - 0.1
       else nx153:= nx153 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx154 := nx154 - 0.1
       else nx154:= nx154 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx155 := nx155 - 0.1
       else nx155:= nx155 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx156 := nx156 - 0.1
       else nx156:= nx156 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx157 := nx157 - 0.1
       else nx157:= nx157 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx158 := nx158 - 0.1
       else nx158:= nx158 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx159 := nx159 - 0.1
       else nx159:= nx159 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx160 := nx160 - 0.1
       else nx160:= nx160 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx161 := nx161 - 0.1
       else nx161:= nx161 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;
  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx162 := nx162 - 0.1
       else nx162:= nx162 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx163 := nx163 - 0.1
       else nx163:= nx163 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx164 := nx164 - 0.1
       else nx164:= nx164 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx165 := nx165 - 0.1
       else nx165:= nx165 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx166 := nx166 - 0.1
       else nx166:= nx166 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx167 := nx167 - 0.1
       else nx167:= nx167 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx168 := nx168 - 0.1
       else nx168:= nx168 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx169 := nx169 - 0.1
       else nx169:= nx169 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx170 := nx170 - 0.1
       else nx170:= nx170 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx171 := nx171 - 0.1
       else nx171:= nx171 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx172 := nx172 - 0.1
       else nx172:= nx172 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx173 := nx173 - 0.1
       else nx173:= nx173 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx174 := nx174 - 0.1
       else nx174:= nx174 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx175 := nx175 - 0.1
       else nx175:= nx175 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx176 := nx176 - 0.1
       else nx176:= nx176 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;
  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx177 := nx177 - 0.1
       else nx177:= nx177 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx178 := nx178 - 0.1
       else nx178:= nx178 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx179 := nx179 - 0.1
       else nx179:= nx179 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx180 := nx180 - 0.1
       else nx180:= nx180 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx181 := nx181 - 0.1
       else nx181:= nx181 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx182 := nx182 - 0.1
       else nx182:= nx182 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx183 := nx183 - 0.1
       else nx183:= nx183 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx184 := nx184 - 0.1
       else nx184:= nx184 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx185 := nx185 - 0.1
       else nx185:= nx185 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx186 := nx186 - 0.1
       else nx186:= nx186 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx187 := nx187 - 0.1
       else nx187:= nx187 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx188 := nx188 - 0.1
       else nx188:= nx188 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

    If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx189 := nx189 - 0.1
       else nx189:= nx189 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx190 := nx190 - 0.1
       else nx190:= nx190 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx191 := nx191 - 0.1
       else nx191:= nx191 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx192 := nx192 - 0.1
       else nx192:= nx192 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx193 := nx193 - 0.1
       else nx193:= nx193 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx194 := nx194 - 0.1
       else nx194:= nx194 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx195 := nx195 - 0.1
       else nx195:= nx195 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx196 := nx196 - 0.1
       else nx196:= nx196 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx197 := nx197 - 0.1
       else nx197 := nx197 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx198 := nx198 - 0.1
       else nx198 := nx198 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx199 := nx199 - 0.1
       else nx199 := nx199 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx200 := nx200 - 0.1
       else nx200 := nx200 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx201 := nx201 - 0.1
       else nx201 := nx201 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx202 := nx202 - 0.1
       else nx202 := nx202 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx203 := nx203 - 0.1
       else nx203 := nx203 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx204 := nx204 - 0.1
       else nx204 := nx204 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx205 := nx205 - 0.1
       else nx205 := nx205 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx206 := nx206 - 0.1
       else nx206 := nx206 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx207 := nx207 - 0.1
       else nx207 := nx207 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx208 := nx208 - 0.1
       else nx208 := nx208 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx209 := nx209 - 0.1
       else nx209 := nx209 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx210 := nx210 - 0.1
       else nx210 := nx210 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx211 := nx211 - 0.1
       else nx211 := nx211 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

   If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx212 := nx212 - 0.1
       else nx212 := nx212 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx213 := nx213 - 0.1
       else nx213 := nx213 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx215 := nx215 - 0.1
       else nx215 := nx215 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx216 := nx216 - 0.1
       else nx216 := nx216 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx217 := nx217 - 0.1
       else nx217 := nx217 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;





  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx := nx - 0.1
       else nx := nx + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx207 := nx207 - 0.1
       else nx207 := nx207 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx208 := nx208 - 0.1
       else nx208 := nx208 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx209 := nx209 - 0.1
       else nx209 := nx209 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx210 := nx210 - 0.1
       else nx210 := nx210 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;


  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx211 := nx211 - 0.1
       else nx211 := nx211 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx212 := nx212 - 0.1
       else nx212 := nx212 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx213 := nx213 - 0.1
       else nx213 := nx213 + 0.1;
   InvalidateRect(Handle, nil, False);
 end;


 If Key = VK_LEFT then begin
    If ssShift in Shift
       then nx218 := nx218 - 0.1
       else nx218 := nx218 + 0.1;
   InvalidateRect(Handle, nil, False);
 end  ;


 If Key = VK_RIGHT then begin
    If ssShift in Shift
       then
       begin
       shag :=1;
       shag1:=2;
       end
       else shag :=shag-1;
 InvalidateRect(Handle, nil, False);
 end;
 /////////////////////////
 ///
 ///
 ///
 ///
 ///


 ///
 ///
 ///
 If Key = VK_UP then begin
    If ssShift in Shift
       then nz92 := nz92 - 0.1
       else nz92 := nz92 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz93 := nz93 - 0.1
       else nz93 := nz93 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz94 := nz94 - 0.1
       else nz94 := nz94 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz95 := nz95 - 0.1
       else nz95 := nz95 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

      If Key = VK_UP then begin
    If ssShift in Shift
       then nz96 := nz96 - 0.1
       else nz96 := nz96 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz97 := nz97 - 0.1
       else nz97 := nz97 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz98 := nz98 - 0.1
       else nz98 := nz98 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

      If Key = VK_UP then begin
    If ssShift in Shift
       then nz99 := nz99 - 0.1
       else nz99 := nz99 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz100 := nz100 - 0.1
       else nz100 := nz100 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

       If Key = VK_UP then begin
    If ssShift in Shift
       then nz101 := nz101 - 0.1
       else nz101 := nz101 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz102 := nz102 - 0.1
       else nz102 := nz102 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz103 := nz103 - 0.1
       else nz103 := nz103 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz104 := nz104 - 0.1
       else nz104 := nz104 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

       If Key = VK_UP then begin
    If ssShift in Shift
       then nz105 := nz105 - 0.1
       else nz105 := nz105+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

      If Key = VK_UP then begin
    If ssShift in Shift
       then nz106 := nz106 - 0.1
       else nz106 := nz106+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

      If Key = VK_UP then begin
    If ssShift in Shift
       then nz107 := nz107 - 0.1
       else nz107 := nz107+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

      If Key = VK_UP then begin
    If ssShift in Shift
       then nz108 := nz108 - 0.1
       else nz108 := nz108+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;
      If Key = VK_UP then begin
    If ssShift in Shift
       then nz109 := nz109 - 0.1
       else nz109 := nz109+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;
      If Key = VK_UP then begin
    If ssShift in Shift
       then nz110 := nz110 - 0.1
       else nz110 := nz110+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;
      If Key = VK_UP then begin
    If ssShift in Shift
       then nz111 := nz111 - 0.1
       else nz111 := nz111+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;
   If Key = VK_UP then begin
    If ssShift in Shift
       then nz112 := nz112 - 0.1
       else nz112 := nz112+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

      If Key = VK_UP then begin
    If ssShift in Shift
       then nz113 := nz113 - 0.1
       else nz113 := nz113+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz114 := nz114 - 0.1
       else nz114 := nz114+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz115 := nz115 - 0.1
       else nz115 := nz115+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz116 := nz116 - 0.1
       else nz116 := nz116+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz117 := nz117 - 0.1
       else nz117 := nz117+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz118 := nz118 - 0.1
       else nz118 := nz118+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz119 := nz119 - 0.1
       else nz119 := nz119+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz120 := nz120 - 0.1
       else nz120 := nz120+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz121 := nz121 - 0.1
       else nz121 := nz121+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz122 := nz122 - 0.1
       else nz122 := nz122+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz123 := nz123 - 0.1
       else nz123 := nz123+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz124 := nz124 - 0.1
       else nz124 := nz124+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz125 := nz125 - 0.1
       else nz125 := nz125+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz126 := nz126 - 0.1
       else nz126 := nz126+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz127 := nz127 - 0.1
       else nz127 := nz127+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz128 := nz128 - 0.1
       else nz128 := nz128+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz129 := nz129 - 0.1
       else nz129 := nz129+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

      If Key = VK_UP then begin
    If ssShift in Shift
       then nz130 := nz130 - 0.1
       else nz130 := nz130+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz131 := nz131 - 0.1
       else nz131 := nz131+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz132 := nz132 - 0.1
       else nz132 := nz132+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz133 := nz133 - 0.1
       else nz133 := nz133+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz134 := nz134 - 0.1
       else nz134 := nz134+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz135 := nz135 - 0.1
       else nz135 := nz135+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz136 := nz136 - 0.1
       else nz136 := nz136+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz137 := nz137 - 0.1
       else nz137 := nz137+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz138 := nz138 - 0.1
       else nz138 := nz138+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz139 := nz139 - 0.1
       else nz139 := nz139+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz140 := nz140 - 0.1
       else nz140 := nz140+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz141 := nz141 - 0.1
       else nz141 := nz141+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz142 := nz142 - 0.1
       else nz142 := nz142+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz143 := nz143 - 0.1
       else nz143 := nz143+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz144 := nz144 - 0.1
       else nz144 := nz144+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz145 := nz145 - 0.1
       else nz145 := nz145+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz146 := nz146 - 0.1
       else nz146 := nz146+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz147 := nz147 - 0.1
       else nz147 := nz147+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz148 := nz148 - 0.1
       else nz148 := nz148+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz149 := nz149 - 0.1
       else nz149 := nz149+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz150 := nz150 - 0.1
       else nz150 := nz150+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz151 := nz151 - 0.1
       else nz151 := nz151+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz152 := nz152 - 0.1
       else nz152 := nz152+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz153 := nz153 - 0.1
       else nz153 := nz153+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz154 := nz154 - 0.1
       else nz154 := nz154+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz155 := nz155 - 0.1
       else nz155 := nz155+ 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz156 := nz156 - 0.1
       else nz156 := nz156 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz157 := nz157 - 0.1
       else nz157 := nz157 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz158 := nz158 - 0.1
       else nz158 := nz158 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

      If Key = VK_UP then begin
    If ssShift in Shift
       then nz159 := nz159 - 0.1
       else nz159 := nz159 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz160 := nz160 - 0.1
       else nz160 := nz160 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz161 := nz161 - 0.1
       else nz161 := nz161 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz162 := nz162 - 0.1
       else nz162 := nz162 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz163 := nz163 - 0.1
       else nz163 := nz163 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz164 := nz164 - 0.1
       else nz164 := nz164 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz165 := nz165 - 0.1
       else nz165 := nz165 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz166 := nz166 - 0.1
       else nz166 := nz166 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz167 := nz167 - 0.1
       else nz167 := nz167 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz168 := nz168 - 0.1
       else nz168 := nz168 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz169 := nz169 - 0.1
       else nz169 := nz169 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz170 := nz170 - 0.1
       else nz170 := nz170 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz171 := nz171 - 0.1
       else nz171 := nz171 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz172 := nz172 - 0.1
       else nz172 := nz172 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz173 := nz173 - 0.1
       else nz173 := nz173 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz174 := nz174 - 0.1
       else nz174 := nz174 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz175 := nz175 - 0.1
       else nz175 := nz175 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz176 := nz176 - 0.1
       else nz176 := nz176 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz177 := nz177 - 0.1
       else nz177 := nz177 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz178 := nz178 - 0.1
       else nz178 := nz178 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz179 := nz179 - 0.1
       else nz179 := nz179 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz180 := nz180 - 0.1
       else nz180 := nz180 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz181 := nz181 - 0.1
       else nz181 := nz181 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz182 := nz182 - 0.1
       else nz182 := nz182 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz183 := nz183 - 0.1
       else nz183 := nz183 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz184 := nz184 - 0.1
       else nz184 := nz184 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz185 := nz185 - 0.1
       else nz185 := nz185 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz186 := nz186 - 0.1
       else nz186 := nz186 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz187 := nz187 - 0.1
       else nz187 := nz187 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz188 := nz188 - 0.1
       else nz188 := nz188 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz189 := nz189 - 0.1
       else nz189 := nz189 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz190 := nz190 - 0.1
       else nz190 := nz190 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz191 := nz191 - 0.1
       else nz191 := nz191 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz192 := nz192 - 0.1
       else nz192 := nz192 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz193 := nz193 - 0.1
       else nz193 := nz193 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz194 := nz194 - 0.1
       else nz194 := nz194 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz195 := nz195 - 0.1
       else nz195 := nz195 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz196 := nz196 - 0.1
       else nz196 := nz196 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz197 := nz197 - 0.1
       else nz197 := nz197 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz198 := nz198 - 0.1
       else nz198 := nz198 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz199 := nz199 - 0.1
       else nz199 := nz199 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz200 := nz200 - 0.1
       else nz200 := nz200 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz201 := nz201 - 0.1
       else nz201 := nz201 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz202 := nz202 - 0.1
       else nz202 := nz202 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz203 := nz203 - 0.1
       else nz203 := nz203 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz204 := nz204 - 0.1
       else nz204 := nz204 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

      If Key = VK_UP then begin
    If ssShift in Shift
       then nz204 := nz204 - 0.1
       else nz204 := nz204 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz205 := nz205 - 0.1
       else nz205 := nz205 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz206 := nz206 - 0.1
       else nz206 := nz206 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz207 := nz207 - 0.1
       else nz207 := nz207 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz208 := nz208 - 0.1
       else nz208 := nz208 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz209 := nz209 - 0.1
       else nz209 := nz209 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;


    If Key = VK_UP then begin
    If ssShift in Shift
       then nz210 := nz210 - 0.1
       else nz210 := nz210 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz211 := nz211 - 0.1
       else nz211 := nz211 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz212 := nz212 - 0.1
       else nz212 := nz212 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz213 := nz213 - 0.1
       else nz213 := nz213 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz215 := nz215 - 0.1
       else nz215 := nz215 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz216 := nz216 - 0.1
       else nz216 := nz216 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz217 := nz217 - 0.1
       else nz217 := nz217 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz218 := nz218 - 0.1
       else nz218 := nz218 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;
 ///
 ///
 ///
 ///
 ///
 ///
 ///

 If Key = VK_UP then begin
    If ssShift in Shift
       then nz64 := nz64 - 0.1
       else nz64 := nz64 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

 If Key = VK_UP then begin
    If ssShift in Shift
       then nz63 := nz63 - 0.1
       else nz63 := nz63 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;


 If Key = VK_UP then begin
    If ssShift in Shift
       then nz62 := nz62 - 0.1
       else nz62 := nz62 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;


 If Key = VK_UP then begin
    If ssShift in Shift
       then nz61 := nz61 - 0.1
       else nz61 := nz61 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

If Key = VK_UP then begin
    If ssShift in Shift
       then nz60 := nz60 - 0.1
       else nz60 := nz60 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;


If Key = VK_UP then begin
    If ssShift in Shift
       then nz59 := nz59 - 0.1
       else nz59 := nz59 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;


 If Key = VK_UP then begin
    If ssShift in Shift
       then nz58 := nz58 - 0.1
       else nz58 := nz58 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;


 If Key = VK_UP then begin
    If ssShift in Shift
       then nz57 := nz57 - 0.1
       else nz57 := nz57 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz56 := nz56 - 0.1
       else nz56 := nz56 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz55 := nz55 - 0.1
       else nz55 := nz55 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

 If Key = VK_UP then begin
    If ssShift in Shift
       then nz54 := nz54 - 0.1
       else nz54 := nz54 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz53 := nz53 - 0.1
       else nz53 := nz53 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz52 := nz52 - 0.1
       else nz52 := nz52 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;


 If Key = VK_UP then begin
    If ssShift in Shift
       then nz51 := nz51 - 0.1
       else nz51 := nz51 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;


 If Key = VK_UP then begin
    If ssShift in Shift
       then nz50 := nz50 - 0.1
       else nz50 := nz50 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;


  If Key = VK_UP then begin
    If ssShift in Shift
       then nz49 := nz49 - 0.1
       else nz49 := nz49 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;



 If Key = VK_UP then begin
    If ssShift in Shift
       then nz48 := nz48 - 0.1
       else nz48 := nz48 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

 If Key = VK_UP then begin
    If ssShift in Shift
       then nz47 := nz47 - 0.1
       else nz47 := nz47 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;


 If Key = VK_UP then begin
    If ssShift in Shift
       then nz46 := nz46 - 0.1
       else nz46 := nz46 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;



  If Key = VK_UP then begin
    If ssShift in Shift
       then nz45 := nz45 - 0.1
       else nz45 := nz45 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz44 := nz44 - 0.1
       else nz44 := nz44 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

 If Key = VK_UP then begin
    If ssShift in Shift
       then nz43 := nz43 - 0.1
       else nz43 := nz43 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

 If Key = VK_UP then begin
    If ssShift in Shift
       then nz42 := nz42 - 0.1
       else nz42 := nz42 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

 If Key = VK_UP then begin
    If ssShift in Shift
       then nz41 := nz41 - 0.1
       else nz41 := nz41 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz40 := nz40 - 0.1
       else nz40 := nz40 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

 If Key = VK_UP then begin
    If ssShift in Shift
       then nz39 := nz39 - 0.1
       else nz39 := nz39 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz38 := nz38 - 0.1
       else nz38 := nz38 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz37 := nz37 - 0.1
       else nz37 := nz37 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;
  If Key = VK_UP then begin
    If ssShift in Shift
       then nz36 := nz36 - 0.1
       else nz36 := nz36 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;
  If Key = VK_UP then begin
    If ssShift in Shift
       then nz35 := nz35 - 0.1
       else nz35 := nz35 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;
  If Key = VK_UP then begin
    If ssShift in Shift
       then nz34 := nz34 - 0.1
       else nz34 := nz34 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz33 := nz33 - 0.1
       else nz33 := nz33 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz32 := nz32 - 0.1
       else nz32 := nz32 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;
  If Key = VK_UP then begin
    If ssShift in Shift
       then nz31 := nz31 - 0.1
       else nz31 := nz31 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz30 := nz30 - 0.1
       else nz30 := nz30 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz29 := nz29 - 0.1
       else nz29 := nz29 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz28 := nz28 - 0.1
       else nz28 := nz28 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz27 := nz27 - 0.1
       else nz27 := nz27 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz26 := nz26 - 0.1
       else nz26 := nz26 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz25 := nz25 - 0.1
       else nz25 := nz25 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

 If Key = VK_UP then begin
    If ssShift in Shift
       then nz24 := nz24 - 0.1
       else nz24 := nz24 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz23 := nz23 - 0.1
       else nz23 := nz23 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

 If Key = VK_UP then begin
    If ssShift in Shift
       then nz22 := nz22 - 0.1
       else nz22 := nz22 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz21 := nz21 - 0.1
       else nz21 := nz21 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz20 := nz20 - 0.1
       else nz20 := nz20 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;


       If Key = VK_UP then begin
    If ssShift in Shift
       then nz19 := nz19 - 0.1
       else nz19 := nz19 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;


      If Key = VK_UP then begin
    If ssShift in Shift
       then nz18 := nz18 - 0.1
       else nz18 := nz18 + 0.1;
 InvalidateRect(Handle, nil, False);
   end;
     If Key = VK_UP then begin
    If ssShift in Shift
       then nz17 := nz17 - 0.1
       else nz17 := nz17 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;
     If Key = VK_UP then begin
    If ssShift in Shift
       then nz16 := nz16 - 0.1
       else nz16 := nz16 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;
     If Key = VK_UP then begin
    If ssShift in Shift
       then nz15 := nz15 - 0.1
       else nz15 := nz15 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;
     If Key = VK_UP then begin
    If ssShift in Shift
       then nz14 := nz14 - 0.1
       else nz14 := nz14 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz13 := nz13 - 0.1
       else nz13 := nz13 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;

    If Key = VK_UP then begin
    If ssShift in Shift
       then nz12 := nz12 - 0.1
       else nz12 := nz12 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;
   If Key = VK_UP then begin
    If ssShift in Shift
       then nz11 := nz11 - 0.1
       else nz11 := nz11 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;


  If Key = VK_UP then begin
    If ssShift in Shift
       then nz10 := nz10 - 0.1
       else nz10 := nz10 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_UP then begin
    If ssShift in Shift
       then nz9 := nz9 - 0.1
       else nz9 := nz9 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz8 := nz8 - 0.1
       else nz8 := nz8 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;


    If Key = VK_UP then begin
    If ssShift in Shift
       then nz7 := nz7 - 0.1
       else nz7 := nz7 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;

   If Key = VK_UP then begin
    If ssShift in Shift
       then nz6 := nz6 - 0.1
       else nz6 := nz6 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;

     If Key = VK_UP then begin
    If ssShift in Shift
       then nz5 := nz5 - 0.1
       else nz5 := nz5 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;


    If Key = VK_UP then begin
    If ssShift in Shift
       then nz4 := nz4 - 0.1
       else nz4 := nz4 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;



   If Key = VK_UP then begin
    If ssShift in Shift
       then nz3 := nz3 - 0.1
       else nz3 := nz3 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz2 := nz2 - 0.1
       else nz2 := nz2 + 0.1;
 InvalidateRect(Handle, nil, False);
 end;

 If Key = VK_UP then begin
    If ssShift in Shift
       then
       begin
        povorot:=3;
        nz1 := nz1 - 0.1 ;
       end
       else
        begin
        povorot:=1;
       nz1 := nz1 + 0.1;
 InvalidateRect(Handle, nil, False);
        end;
 end;
  If Key = VK_UP then begin
    If ssShift in Shift
       then nz := nz - 0.1
       else nz := nz + 0.1;


 InvalidateRect(Handle, nil, False);
 end;

  If Key = VK_UP then begin
    If ssShift in Shift
       then nz := nz - 0.1
       else nz := nz + 0.1;


 InvalidateRect(Handle, nil, False);
 end;
end;

{=======================================================================
Движение мыши}
procedure TfrmGL.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  If down <> 0 then begin
     glRotatef (lastx - x, 1, 90, 0);
     lastx := x;
     InvalidateRect(Handle, nil, False);
  end;
end;

{=======================================================================
Кнопка мыши отжата}
procedure TfrmGL.FormMouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  down := 0;
end;

{=======================================================================
Кнопка мыши нажата}
procedure TfrmGL.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
 If button = mbLeft then begin
    lastx := X;
    wrkX := X;
    wrkY := Y;
    down := 1;
    wrkTime := GetTickCount;
 end;
end;

{=======================================================================
Устанавливаем формат пикселей}
procedure TfrmGL.SetDCPixelFormat;
var
  nPixelFormat: Integer;
  pfd: TPixelFormatDescriptor;

begin
  FillChar(pfd, SizeOf(pfd), 0);

  pfd.dwFlags   := PFD_DRAW_TO_WINDOW or
                 PFD_SUPPORT_OPENGL or
                 PFD_DOUBLEBUFFER;
  nPixelFormat := ChoosePixelFormat(DC, @pfd);
  SetPixelFormat(DC, nPixelFormat, @pfd);
end;


procedure TfrmGL.N1Click(Sender: TObject);
begin
  if OpenDialog.Execute then
    begin
      MyMesh.Destroy; // Уничтожить предыдущий объект
      Mymesh := TGLMultyMesh.Create;
      MyMesh.LoadFromFile( OpenDialog.FileName );
      MyMesh.Extent := true; // Масштабировать
      // Если много сеток - включить кнопку анимации
      if MyMesh.Meshes.Count <= 1 then N2.Enabled := False
      else N2.Enabled := True;
    end;
end;

procedure TfrmGL.N2Click(Sender: TObject);   //корабли
begin
   MyMesh6.Action := not MyMesh6.Action;
  MyMesh3.Action := not MyMesh3.Action;
  MyMesh.Action := not MyMesh.Action; // Вкл/Выкл анимацию
  MyMesh35.Action := not MyMesh.Action;
  MyMesh36.Action := not MyMesh.Action;
  MyMesh37.Action := not MyMesh.Action;
  N2.Checked := not N2.Checked;

end;

procedure TfrmGL.NSmoothClick(Sender: TObject);
begin
  MyMesh.fSmooth := not MyMesh.fSmooth; // Вкл/Выкл сглаживание
end;

procedure TfrmGL.N31Click(Sender: TObject);
begin
  MyMesh2.Destroy; // Уничтожить предыдущий объект
  MyMesh2 := TGLMultyMesh.Create;
  MyMesh2.LoadFromFile( 'm.gms' );
  MyMesh2.Extent := true;  // Масштабировать
  MyMesh2.fSmooth := False; // Установить в фасеты
  if MyMesh2.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
end;

procedure TfrmGL.ballet1Click(Sender: TObject);
begin
 MyMesh2.Destroy; // Уничтожить предыдущий объект
MyMesh2 := TGLMultyMesh.Create;
  MyMesh2.LoadFromFile( 'p1.gms' );
  MyMesh2.Extent := true;  // Масштабировать
  MyMesh2.fSmooth := False; // Установить в фасеты
  if MyMesh2.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;

end;

procedure TfrmGL.chacha1Click(Sender: TObject);
begin
 MyMesh3.Destroy; // Уничтожить предыдущий объект
MyMesh3 := TGLMultyMesh.Create;
  MyMesh3.LoadFromFile( 'vzriv/1.gms' );
  MyMesh3.Extent := true;  // Масштабировать
  MyMesh3.fSmooth := False; // Установить в фасеты
  if MyMesh3.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
end;

procedure TfrmGL.dancehop1Click(Sender: TObject);
begin
 MyMesh3.Destroy; // Уничтожить предыдущий объект
MyMesh3 := TGLMultyMesh.Create;
  MyMesh3.LoadFromFile( 'ko/2.gms' );
  MyMesh3.Extent := true;  // Масштабировать
  MyMesh3.fSmooth := False; // Установить в фасеты
  if MyMesh3.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
end;



procedure TfrmGL.N111Click(Sender: TObject);
begin
chacha1Click(Sender);
sleep(100);
InvalidateRect(Handle, nil, False);





















N3Click(Sender);
 InvalidateRect(Handle, nil, False);
 sleep(1000);





 N23Click(Sender);
InvalidateRect(Handle, nil, False);
end;

procedure TfrmGL.N11Click(Sender: TObject);
begin
MyMesh3.Destroy; // Уничтожить предыдущий объект
MyMesh3 := TGLMultyMesh.Create;
  MyMesh3.LoadFromFile( 'vzriv/2.gms' );
  MyMesh3.Extent := true;  // Масштабировать
  MyMesh3.fSmooth := False; // Установить в фасеты
  if MyMesh3.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
{ MyMesh.Destroy; // Уничтожить предыдущий объект
MyMesh := TGLMultyMesh.Create;
  MyMesh.LoadFromFile( '1\11.gms' );
  MyMesh.Extent := true;  // Масштабировать
  MyMesh.fSmooth := False; // Установить в фасеты
  if MyMesh.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;}
end;

procedure TfrmGL.N121Click(Sender: TObject);
begin
MyMesh2.Destroy; // Уничтожить предыдущий объект
MyMesh2 := TGLMultyMesh.Create;
  MyMesh2.LoadFromFile( 'vzriv/1/2.gms' );
  MyMesh2.Extent := true;  // Масштабировать
  MyMesh2.fSmooth := False; // Установить в фасеты
  if MyMesh2.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
  sleep(100);
InvalidateRect(Handle, nil, False);
end;

procedure TfrmGL.N12Click(Sender: TObject);
begin
Form1.Show;
end;

procedure TfrmGL.N131Click(Sender: TObject);
begin
MyMesh2.Destroy; // Уничтожить предыдущий объект
MyMesh2 := TGLMultyMesh.Create;
  MyMesh2.LoadFromFile( 'vzriv/1/3.gms' );
  MyMesh2.Extent := true;  // Масштабировать
  MyMesh2.fSmooth := False; // Установить в фасеты
  if MyMesh2.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
  sleep(100);
InvalidateRect(Handle, nil, False);
end;

procedure TfrmGL.N141Click(Sender: TObject);
begin
MyMesh2.Destroy; // Уничтожить предыдущий объект
MyMesh2 := TGLMultyMesh.Create;
  MyMesh2.LoadFromFile( 'vzriv/1/4.gms' );
  MyMesh2.Extent := true;  // Масштабировать
  MyMesh2.fSmooth := False; // Установить в фасеты
  if MyMesh2.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
  sleep(100);
InvalidateRect(Handle, nil, False);
end;

procedure TfrmGL.N151Click(Sender: TObject);
begin
  MyMesh2.Destroy; // Уничтожить предыдущий объект
  MyMesh2 := TGLMultyMesh.Create;
  MyMesh2.LoadFromFile( 'vzriv/1/5.gms' );
  MyMesh2.Extent := true;  // Масштабировать
  MyMesh2.fSmooth := False; // Установить в фасеты
  if MyMesh2.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
  sleep(100);
InvalidateRect(Handle, nil, False);
end;

procedure TfrmGL.N161Click(Sender: TObject);
begin
MyMesh32.Destroy; // Уничтожить предыдущий объект
MyMesh32 := TGLMultyMesh.Create;
  MyMesh32.LoadFromFile( 'vzriv/1.gms' );
  MyMesh32.Extent := true;  // Масштабировать
  MyMesh32.fSmooth := False; // Установить в фасеты
  if MyMesh32.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
  sleep(100);
InvalidateRect(Handle, nil, False);

MyMesh32.Destroy; // Уничтожить предыдущий объект
MyMesh32 := TGLMultyMesh.Create;
  MyMesh32.LoadFromFile( 'vzriv/3.gms' );
  MyMesh32.Extent := true;  // Масштабировать
  MyMesh32.fSmooth := False; // Установить в фасеты
  if MyMesh32.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;

  InvalidateRect(Handle, nil, False);
 sleep(1000);

 MyMesh32.Destroy; // Уничтожить предыдущий объект
MyMesh32 := TGLMultyMesh.Create;
  MyMesh32.LoadFromFile( 'vzriv/4.gms' );
  MyMesh32.Extent := true;  // Масштабировать
  MyMesh32.fSmooth := False; // Установить в фасеты
  if MyMesh32.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;











end;

procedure TfrmGL.N171Click(Sender: TObject);
begin
MyMesh33.Destroy; // Уничтожить предыдущий объект
MyMesh33 := TGLMultyMesh.Create;
  MyMesh33.LoadFromFile( 'vzriv/1.gms' );
  MyMesh33.Extent := true;  // Масштабировать
  MyMesh33.fSmooth := False; // Установить в фасеты
  if MyMesh33.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
  sleep(100);
InvalidateRect(Handle, nil, False);

MyMesh33.Destroy; // Уничтожить предыдущий объект
MyMesh33 := TGLMultyMesh.Create;
  MyMesh33.LoadFromFile( 'vzriv/3.gms' );
  MyMesh33.Extent := true;  // Масштабировать
  MyMesh33.fSmooth := False; // Установить в фасеты
  if MyMesh33.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;

  InvalidateRect(Handle, nil, False);
 sleep(1000);

 MyMesh33.Destroy; // Уничтожить предыдущий объект
MyMesh33 := TGLMultyMesh.Create;
  MyMesh33.LoadFromFile( 'vzriv/4.gms' );
  MyMesh33.Extent := true;  // Масштабировать
  MyMesh33.fSmooth := False; // Установить в фасеты
  if MyMesh33.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
end;

procedure TfrmGL.N181Click(Sender: TObject);
begin
MyMesh28.Destroy; // Уничтожить предыдущий объект
MyMesh28 := TGLMultyMesh.Create;
  MyMesh28.LoadFromFile( 'vzriv/1/5.gms' );
  MyMesh28.Extent := true;  // Масштабировать
  MyMesh28.fSmooth := False; // Установить в фасеты
  if MyMesh28.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
  sleep(100);
InvalidateRect(Handle, nil, False);
end;

procedure TfrmGL.N191Click(Sender: TObject);
begin
MyMesh29.Destroy; // Уничтожить предыдущий объект
MyMesh29 := TGLMultyMesh.Create;
  MyMesh29.LoadFromFile( 'vzriv/1/5.gms' );
  MyMesh29.Extent := true;  // Масштабировать
  MyMesh29.fSmooth := False; // Установить в фасеты
  if MyMesh29.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
  sleep(100);
InvalidateRect(Handle, nil, False);
end;

procedure TfrmGL.N201Click(Sender: TObject);
begin
MyMesh30.Destroy; // Уничтожить предыдущий объект
MyMesh30 := TGLMultyMesh.Create;
  MyMesh30.LoadFromFile( 'vzriv/1/5.gms' );
  MyMesh30.Extent := true;  // Масштабировать
  MyMesh30.fSmooth := False; // Установить в фасеты
  if MyMesh30.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
  sleep(100);
InvalidateRect(Handle, nil, False);
end;

procedure TfrmGL.N211Click(Sender: TObject);
begin
  MyMesh31.Destroy; // Уничтожить предыдущий объект
  MyMesh31 := TGLMultyMesh.Create;
  MyMesh31.LoadFromFile( 'vzriv/1/5.gms' );
  MyMesh31.Extent := true;  // Масштабировать
  MyMesh31.fSmooth := False; // Установить в фасеты
  if MyMesh31.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
  sleep(100);
InvalidateRect(Handle, nil, False);


 InvalidateRect(Handle, nil, False);
 sleep(1000);

 InvalidateRect(Handle, nil, False);
end;

procedure TfrmGL.N221Click(Sender: TObject);
begin
MyMesh35.Destroy; // Уничтожить предыдущий объект
  MyMesh35 := TGLMultyMesh.Create;
  MyMesh35.LoadFromFile( 'vzriv/4.gms' );
  MyMesh35.Extent := true;  // Масштабировать
  MyMesh35.fSmooth := False; // Установить в фасеты
  if MyMesh35.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
  sleep(100);
InvalidateRect(Handle, nil, False);


 InvalidateRect(Handle, nil, False);
 sleep(1000);

 InvalidateRect(Handle, nil, False);


end;

procedure TfrmGL.N23Click(Sender: TObject);
begin
MyMesh3.Destroy; // Уничтожить предыдущий объект
MyMesh3 := TGLMultyMesh.Create;
  MyMesh3.LoadFromFile( 'vzriv/4.gms' );
  MyMesh3.Extent := true;  // Масштабировать
  MyMesh3.fSmooth := False; // Установить в фасеты
  if MyMesh3.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
{ MyMesh.Destroy; // Уничтожить предыдущий объект
MyMesh := TGLMultyMesh.Create;
  MyMesh.LoadFromFile( '1\22.gms' );
  MyMesh.Extent := true;  // Масштабировать
  MyMesh.fSmooth := False; // Установить в фасеты
  if MyMesh.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;}
end;

procedure TfrmGL.N32Click(Sender: TObject);
begin
MyMesh3.Destroy; // Уничтожить предыдущий объект
MyMesh3 := TGLMultyMesh.Create;
  MyMesh3.LoadFromFile( 'vzriv/5.gms' );
  MyMesh3.Extent := true;  // Масштабировать
  MyMesh3.fSmooth := False; // Установить в фасеты
  if MyMesh3.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;

{ MyMesh.Destroy; // Уничтожить предыдущий объект
MyMesh := TGLMultyMesh.Create;
  MyMesh.LoadFromFile( '1\33.gms' );
  MyMesh.Extent := true;  // Масштабировать
  MyMesh.fSmooth := False; // Установить в фасеты
  if MyMesh.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;}
end;

procedure TfrmGL.N3Click(Sender: TObject);
begin
MyMesh3.Destroy; // Уничтожить предыдущий объект
MyMesh3 := TGLMultyMesh.Create;
  MyMesh3.LoadFromFile( 'vzriv/3.gms' );
  MyMesh3.Extent := true;  // Масштабировать
  MyMesh3.fSmooth := False; // Установить в фасеты
  if MyMesh3.Meshes.Count <= 1 then N2.Enabled := False
  else N2.Enabled := True;
end;

procedure TfrmGL.N5Click(Sender: TObject);
begin

if x=0 then
begin
N5.Checked:=false;
Panel1.Visible:=false;
x:=1;
end
else
Begin
N5.Checked:=true;
Panel1.Visible:=true;
x:=0;
end;



end;

procedure TfrmGL.N6Click(Sender: TObject);
begin
Step:=1;
end;

procedure TfrmGL.N7Click(Sender: TObject);
begin
Step:=-1;
end;





procedure TfrmGL.N8Click(Sender: TObject);
begin
Form2.Show;
end;

end.

