pprocedure TForm1.InitElements; begin Cesta := ExtractFilePath(Application.ExeName); //cesta k texturam //nacteni textur LoadBitmap(Cesta + 'Image1.bmp'); glGenTextures(1, @textura[0]); glBindTexture(GL_TEXTURE_2D, textura[0]); glTexParameterf(GL_Texture_2D,GL_Texture_Wrap_S,GL_Repeat); glTexParameterf(GL_Texture_2D,GL_Texture_Wrap_T,GL_Repeat); glTexParameterf(GL_Texture_2D,GL_Texture_Mag_Filter,GL_Linear); glTexParameterf(GL_Texture_2D,GL_Texture_Min_Filter,GL_Linear); glTexImage2d(GL_Texture_2D,0,3,Velikost,Velikost,0,GL_RGB,GL_Unsigned_byte,@buffer); LoadBitmap(Cesta + 'Image2.bmp'); glGenTextures(1, @textura[1]); glBindTexture(GL_TEXTURE_2D, textura[1]); glTexParameterf(GL_Texture_2D,GL_Texture_Wrap_S,GL_Repeat); glTexParameterf(GL_Texture_2D,GL_Texture_Wrap_T,GL_Repeat); glTexParameterf(GL_Texture_2D,GL_Texture_Mag_Filter,GL_Linear); glTexParameterf(GL_Texture_2D,GL_Texture_Min_Filter,GL_Linear); glTexImage2d(GL_Texture_2D,0,3,Velikost,Velikost,0,GL_RGB,GL_Unsigned_byte,@buffer); LoadBitmap(Cesta + 'Image3.bmp'); glGenTextures(1, @textura[2]); glBindTexture(GL_TEXTURE_2D, textura[2]); glTexParameterf(GL_Texture_2D,GL_Texture_Wrap_S,GL_Repeat); glTexParameterf(GL_Texture_2D,GL_Texture_Wrap_T,GL_Repeat); glTexParameterf(GL_Texture_2D,GL_Texture_Mag_Filter,GL_Linear); glTexParameterf(GL_Texture_2D,GL_Texture_Min_Filter,GL_Linear); glTexImage2d(GL_Texture_2D,0,3,Velikost,Velikost,0,GL_RGB,GL_Unsigned_byte,@buffer); LoadBitmap(Cesta + 'Image4.bmp'); glGenTextures(1, @textura[3]); glBindTexture(GL_TEXTURE_2D, textura[3]); glTexParameterf(GL_Texture_2D,GL_Texture_Wrap_S,GL_Repeat); glTexParameterf(GL_Texture_2D,GL_Texture_Wrap_T,GL_Repeat); glTexParameterf(GL_Texture_2D,GL_Texture_Mag_Filter,GL_Linear); glTexParameterf(GL_Texture_2D,GL_Texture_Min_Filter,GL_Linear); glTexImage2d(GL_Texture_2D,0,3,Velikost,Velikost,0,GL_RGB,GL_Unsigned_byte,@buffer); LoadBitmap(Cesta + 'Image5.bmp'); glGenTextures(1, @textura[4]); glBindTexture(GL_TEXTURE_2D, textura[4]); glTexParameterf(GL_Texture_2D,GL_Texture_Wrap_S,GL_Repeat); glTexParameterf(GL_Texture_2D,GL_Texture_Wrap_T,GL_Repeat); glTexParameterf(GL_Texture_2D,GL_Texture_Mag_Filter,GL_Linear); glTexParameterf(GL_Texture_2D,GL_Texture_Min_Filter,GL_Linear); glTexImage2d(GL_Texture_2D,0,3,Velikost,Velikost,0,GL_RGB,GL_Unsigned_byte,@buffer); LoadBitmap(Cesta + 'Image6.bmp'); glGenTextures(1, @textura[5]); glBindTexture(GL_TEXTURE_2D, textura[5]); glTexParameterf(GL_Texture_2D,GL_Texture_Wrap_S,GL_Repeat); glTexParameterf(GL_Texture_2D,GL_Texture_Wrap_T,GL_Repeat); glTexParameterf(GL_Texture_2D,GL_Texture_Mag_Filter,GL_Linear); glTexParameterf(GL_Texture_2D,GL_Texture_Min_Filter,GL_Linear); glTexImage2d(GL_Texture_2D,0,3,Velikost,Velikost,0,GL_RGB,GL_Unsigned_byte,@buffer); glEnableClientState(GL_VERTEX_ARRAY); //aktivuje pole bodu glEnableClientState(GL_TEXTURE_COORD_ARRAY); //aktivuje pole texturovych koordinaci ///////////////////////////////////////////////////////////////////////////// //prvni stena //pozice bodu 1 VertexPointer[0].X := -10; VertexPointer[0].Y := 2; VertexPointer[0].Z := 0; //texturova koordinace bodu 1 CoordPointer[0].S := 4; CoordPointer[0].K := 1; //identifikace bodu 1 Indices[0] := 0; //pozice bodu 2 VertexPointer[1].X := 10; VertexPointer[1].Y := 2; VertexPointer[1].Z := 0; //texturova koordinace bodu 2 CoordPointer[1].S := 0; CoordPointer[1].K := 1; //identifikace bodu 2 Indices[1] := 1; //pozice bodu 3 VertexPointer[2].X := -10; VertexPointer[2].Y := -1; VertexPointer[2].Z := 0; //texturova koordinace bodu 3 CoordPointer[2].S := 4; CoordPointer[2].K := 0; //identifikace bodu 3 Indices[2] := 2; //druhy trojuhelnik VertexPointer[3].X := -10; VertexPointer[3].Y := -1; VertexPointer[3].Z := 0; CoordPointer[3].S := 4; CoordPointer[3].K := 0; Indices[3] := 3; VertexPointer[4].X := 10; VertexPointer[4].Y := 2; VertexPointer[4].Z := 0; CoordPointer[4].S := 0; CoordPointer[4].K := 1; Indices[4] := 4; VertexPointer[5].X := 10; VertexPointer[5].Y := -1; VertexPointer[5].Z := 0; CoordPointer[5].S := 0; CoordPointer[5].K := 0; Indices[5] := 5; ///////////////////////////////////////////////////////////////////////////// //druha stena //pozice bodu 1 VertexPointer2[0].X := 10; VertexPointer2[0].Y := 2; VertexPointer2[0].Z := -20; //texturova koordinace bodu 1 CoordPointer2[0].S := 4; CoordPointer2[0].K := 1; //identifikace bodu 1 Indices2[0] := 0; //pozice bodu 2 VertexPointer2[1].X := 10; VertexPointer2[1].Y := 2; VertexPointer2[1].Z := 0; //texturova koordinace bodu 2 CoordPointer2[1].S := 0; CoordPointer2[1].K := 1; //identifikace bodu 2 Indices2[1] := 1; //pozice bodu 3 VertexPointer2[2].X := 10; VertexPointer2[2].Y := -1; VertexPointer2[2].Z := -20; //texturova koordinace bodu 3 CoordPointer2[2].S := 4; CoordPointer2[2].K := 0; //identifikace bodu 3 Indices2[2] := 2; //druhy trojuhelnik VertexPointer2[3].X := 10; VertexPointer2[3].Y := -1; VertexPointer2[3].Z := -20; CoordPointer2[3].S := 4; CoordPointer2[3].K := 0; Indices2[3] := 3; VertexPointer2[4].X := 10; VertexPointer2[4].Y := 2; VertexPointer2[4].Z := 0; CoordPointer2[4].S := 0; CoordPointer2[4].K := 1; Indices2[4] := 4; VertexPointer2[5].X := 10; VertexPointer2[5].Y := -1; VertexPointer2[5].Z := 0; CoordPointer2[5].S := 0; CoordPointer2[5].K := 0; Indices2[5] := 5; ///////////////////////////////////////////////////////////////////////////// //treti stena //pozice bodu 1 VertexPointer3[0].X := -10; VertexPointer3[0].Y := 2; VertexPointer3[0].Z := -20; //texturova koordinace bodu 1 CoordPointer3[0].S := 4; CoordPointer3[0].K := 1; //identifikace bodu 1 Indices3[0] := 0; //pozice bodu 2 VertexPointer3[1].X := 10; VertexPointer3[1].Y := 2; VertexPointer3[1].Z := -20; //texturova koordinace bodu 2 CoordPointer3[1].S := 0; CoordPointer3[1].K := 1; //identifikace bodu 2 Indices3[1] := 1; //pozice bodu 3 VertexPointer3[2].X := -10; VertexPointer3[2].Y := -1; VertexPointer3[2].Z := -20; //texturova koordinace bodu 3 CoordPointer3[2].S := 4; CoordPointer3[2].K := 0; //identifikace bodu 3 Indices3[2] := 2; //druhy trojuhelnik VertexPointer3[3].X := -10; VertexPointer3[3].Y := -1; VertexPointer3[3].Z := -20; CoordPointer3[3].S := 4; CoordPointer3[3].K := 0; Indices3[3] := 3; VertexPointer3[4].X := 10; VertexPointer3[4].Y := 2; VertexPointer3[4].Z := -20; CoordPointer3[4].S := 0; CoordPointer3[4].K := 1; Indices3[4] := 4; VertexPointer3[5].X := 10; VertexPointer3[5].Y := -1; VertexPointer3[5].Z := -20; CoordPointer3[5].S := 0; CoordPointer3[5].K := 0; Indices3[5] := 5; ///////////////////////////////////////////////////////////////////////////// //ctvrta stena //pozice bodu 1 VertexPointer4[0].X := -10; VertexPointer4[0].Y := 2; VertexPointer4[0].Z := -20; //texturova koordinace bodu 1 CoordPointer4[0].S := 4; CoordPointer4[0].K := 1; //identifikace bodu 1 Indices4[0] := 0; //pozice bodu 2 VertexPointer4[1].X := -10; VertexPointer4[1].Y := 2; VertexPointer4[1].Z := 0; //texturova koordinace bodu 2 CoordPointer4[1].S := 0; CoordPointer4[1].K := 1; //identifikace bodu 2 Indices4[1] := 1; //pozice bodu 3 VertexPointer4[2].X := -10; VertexPointer4[2].Y := -1; VertexPointer4[2].Z := -20; //texturova koordinace bodu 3 CoordPointer4[2].S := 4; CoordPointer4[2].K := 0; //identifikace bodu 3 Indices4[2] := 2; //druhy trojuhelnik VertexPointer4[3].X := -10; VertexPointer4[3].Y := -1; VertexPointer4[3].Z := -20; CoordPointer4[3].S := 4; CoordPointer4[3].K := 0; Indices4[3] := 3; VertexPointer4[4].X := -10; VertexPointer4[4].Y := 2; VertexPointer4[4].Z := 0; CoordPointer4[4].S := 0; CoordPointer4[4].K := 1; Indices4[4] := 4; VertexPointer4[5].X := -10; VertexPointer4[5].Y := -1; VertexPointer4[5].Z := 0; CoordPointer4[5].S := 0; CoordPointer4[5].K := 0; Indices4[5] := 5; ///////////////////////////////////////////////////////////////////////////// //strop //pozice bodu 1 VertexPointer5[0].X := -10; VertexPointer5[0].Y := 2; VertexPointer5[0].Z := -20; //texturova koordinace bodu 1 CoordPointer5[0].S := 10; CoordPointer5[0].K := 10; //identifikace bodu 1 Indices5[0] := 0; //pozice bodu 2 VertexPointer5[1].X := -10; VertexPointer5[1].Y := 2; VertexPointer5[1].Z := 0; //texturova koordinace bodu 2 CoordPointer5[1].S := 0; CoordPointer5[1].K := 10; //identifikace bodu 2 Indices5[1] := 1; //pozice bodu 3 VertexPointer5[2].X := 10; VertexPointer5[2].Y := 2; VertexPointer5[2].Z := -20; //texturova koordinace bodu 3 CoordPointer5[2].S := 10; CoordPointer5[2].K := 0; //identifikace bodu 3 Indices5[2] := 2; //druhy trojuhelnik VertexPointer5[3].X := 10; VertexPointer5[3].Y := 2; VertexPointer5[3].Z := -20; CoordPointer5[3].S := 10; CoordPointer5[3].K := 0; Indices5[3] := 3; VertexPointer5[4].X := -10; VertexPointer5[4].Y := 2; VertexPointer5[4].Z := 0; CoordPointer5[4].S := 0; CoordPointer5[4].K := 10; Indices5[4] := 4; VertexPointer5[5].X := 10; VertexPointer5[5].Y := 2; VertexPointer5[5].Z := 0; CoordPointer5[5].S := 0; CoordPointer5[5].K := 0; Indices5[5] := 5; ///////////////////////////////////////////////////////////////////////////// //podhlaha //pozice bodu 1 VertexPointer6[0].X := -10; VertexPointer6[0].Y := -1; VertexPointer6[0].Z := -20; //texturova koordinace bodu 1 CoordPointer6[0].S := 10; CoordPointer6[0].K := 10; //identifikace bodu 1 Indices6[0] := 0; //pozice bodu 2 VertexPointer6[1].X := -10; VertexPointer6[1].Y := -1; VertexPointer6[1].Z := 0; //texturova koordinace bodu 2 CoordPointer6[1].S := 0; CoordPointer6[1].K := 10; //identifikace bodu 2 Indices6[1] := 1; //pozice bodu 3 VertexPointer6[2].X := 10; VertexPointer6[2].Y := -1; VertexPointer6[2].Z := -20; //texturova koordinace bodu 3 CoordPointer6[2].S := 10; CoordPointer6[2].K := 0; //identifikace bodu 3 Indices6[2] := 2; //druhy trojuhelnik VertexPointer6[3].X := 10; VertexPointer6[3].Y := -1; VertexPointer6[3].Z := -20; CoordPointer6[3].S := 10; CoordPointer6[3].K := 0; Indices6[3] := 3; VertexPointer6[4].X := -10; VertexPointer6[4].Y := -1; VertexPointer6[4].Z := 0; CoordPointer6[4].S := 0; CoordPointer6[4].K := 10; Indices6[4] := 4; VertexPointer6[5].X := 10; VertexPointer6[5].Y := -1; VertexPointer6[5].Z := 0; CoordPointer6[5].S := 0; CoordPointer6[5].K := 0; Indices6[5] := 5; end;