tify"> {Top Face} f (0.0, 1.0, 0.0); f (1.0, 1.0); glVertex3f (2.5, 2.5, - 2.5); f (0.0, 1.0); glVertex3f (- 2.5, 2.5, - 2.5); f (0.0, 0.0); glVertex3f (- 2.5, 2.5, 2.5); f (1.0, 0.0); glVertex3f (2.5, 2.5, 2.5);
{Bottom Face} f (0.0, - 1.0, 0.0); f (1.0, 1.0); glVertex3f (- 2.5, - 2.5, - 2.5); f (0.0, 1.0); glVertex3f (2.5, - 2.5, - 2.5); f (0.0, 0.0); glVertex3f (2.5, - 2.5, 2.5); f (1.0, 0.0); glVertex3f (- 2.5, - 2.5, 2.5) ;;;:=BackList + 1; (CubeList, GL_COMPILE); (GL_TEXTURE_2D, textures [1]); (GL_TRIANGLES);
{Back Face} f (0.0, 0.0, - 1.0); f (0.0, 0.0); glVertex3f (0.5, - 0.5, - 0.5); f (1.0, 0.0); glVertex3f (- 0.5, - 0.5, - 0.5); f (1.0, 1.0); glVertex3f (- 0.5, 0.5, - 0.5) ;; (GL_TEXTURE_2D, textures [1]); (GL_TRIANGLES);
{Left Face} f (- 1.0, 0.0, 0.0); f (0.0, 1.0); glVertex3f (- 0.5, 0.5, - 0.5); f (0.0, 0.0); glVertex3f (- 0.5, - 0.5, - 0.5); f (1.0, 0.0); glVertex3f (- 0.5, - 0.5, 0.5) ;; (GL_TEXTURE_2D, textures [2]) ;;;: TDateTime ;: integer; OpenGLControl1.MakeCurrent thennot AreaInitialized then begin ;; (GL_PROJECTION); {Prepare for and then} (); {Define the projection} (- 1.0, 1.0, - 1.0, 1.0, 1.5, 20.0); {Transformation} (GL_MODELVIEW); {Back to modelview matrix} (0, 0, OpenGLControl1.Width, OpenGLControl1.Height);
{define the viewport}:=true ;;:=Now;:=round (CurTime * 86400 * 1000) mod 1000; MSecs lt; 0 then MSecs:=1000 + MSecs;:=msecs-LastMsecs; timer lt; 0 then timer:=1000 + timer;:=MSecs;
//ParticleEngine.MoveParticles; (GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT) ;; {Clear the matrix} (0.0, 0.0, - 3.0);// - 2.5); {Viewing transformation}
{rotate};
//draw backgroundblended then begin (GL_BLEND); (GL_DEPTH_TEST) ;; (BackList) ;;; MoveCube then begin
//rx:=rx + 0.5 * (timer/10);:=ry + 0.025 * timer;
//rz:=rz + 0.8 * (timer/10) ;;
//glRotatef (rx, 1.0,0.0,0.0); (ry, 0.0,1.0,0.0);
//glRotatef (rz, 0.0,0.0,1.0);
//draw cube (CubeList); blended then begin (GL_BLEND); (GL_DEPTH_TEST) ;;;. SwapBuffers ;;; TExampleForm.OpenGLControl1Resize (Sender: TObject); (AreaInitialized) OpenGLControl1.MakeCurrent then (0, 0, OpenGLControl1.Width, OpenGLControl1.Height) ;;
{TglTexture} TglTexture.Destroy; Data lt; gt; nil then FreeMem (Data); Destroy ;;.
Додаток Б
Малюнок 1 - Розстановка об'єктів в сцені
програма випробування дана
Малюнок 2 - Текстурування об'єктів
Малюнок 3 - Рух об'єктів щодо загальної боку в просторі