Уроки, алгоритмы, программы, примеры

Материалы по разделам

Построения
на плоскости (2D)
Графика
в пространстве (3D)
Вычислительная
геометрия
Физическое
моделирование
Фрактальная
графика

Новые комментарии

У меня проблема вот с этим: gl.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT);. Вылезает ошибка: CS1061 "object" не содержит определения "GL_COLOR_BUFFER_BIT", и не удалось найти доступный метод расширения "GL_COLOR_BUFFER_BIT",...
Большое спасибо. Единственный код который прошел без каких либо ошибок. Ура!!!
Скажите пожалуйста, подскажите алгоритм по которому по заданным точкам можно определить тип многогранника, скажем это куб или прямоугольный параллелепипед. Нашел теорию по этим фигурам: https://www.mat... https://www.mat... Акцентировать внимание...
Всем у кого не работает. файл wizard.script Ещё одно упоминание Glut32 в строке "if (!VerifyLibFile(dir_nomacro_lib, _T("glut32"), _T("GLUT's"))) return false;" меняем на "if (!VerifyLibFile(dir_nomacro_lib, _T("freeglut"), _T("GLUT's"))) return...
Не получается, емаё

Счетчики и рейтинг

Рейтинг@Mail.ru Яндекс.Метрика
Среда программирования: 
Embarcadero® Delphi® XE Version 15.0

unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls;
 
type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Image1: TImage;
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
    Procedure RotateRect;
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.DFM}
 
procedure TForm1.FormCreate(Sender: TObject);
begin
 DoubleBuffered := true;
end;
 
procedure TForm1.RotateRect;
Const N = 55;
      DT = 20;
      SD = 0;
 
Const IC : Integer = 250;
      ID : ShortInt = -1;
Var Col        : TColor;
    RC, GC, BC : Integer; // Составляющие цвета
    Pnt        : Array [1..4] of TPoint;
    mx, my     : Integer;
    d          : ShortInt;
    i          : Integer;
begin
  With Image1 do begin
    Pnt[1].x := SD;
    Pnt[1].y := SD;
    Pnt[2].x := Width - SD;
    Pnt[2].y := SD;
    Pnt[3].x := Width - SD;
    Pnt[3].y := Height - SD;
    Pnt[4].x := SD;
    Pnt[4].y := Height - SD;
    GC :=0; RC := 0; BC := IC;
    d := id;
    Col := RGB( BC, GC, BC);
    Canvas.Pen.Color   := Col;
    Canvas.Brush.Color := Col;
    Canvas.Polygon( Pnt);
    For i:=1 to N do begin
      mx := Pnt[1].x;
      my := Pnt[1].y;
      Pnt[1].x := Pnt[1].x + (Pnt[2].x - Pnt[1].x) div DT;
      Pnt[1].y := Pnt[1].y + (Pnt[2].y - Pnt[1].y) div DT;
      Pnt[2].x := Pnt[2].x + (Pnt[3].x - Pnt[2].x) div DT;
      Pnt[2].y := Pnt[2].y + (Pnt[3].y - Pnt[2].y) div DT;
      Pnt[3].x := Pnt[3].x + (Pnt[4].x - Pnt[3].x) div DT;
      Pnt[3].y := Pnt[3].y + (Pnt[4].y - Pnt[3].y) div DT;
      Pnt[4].x := Pnt[4].x + (mx - Pnt[4].x) div DT;
      Pnt[4].y := Pnt[4].y + (my - Pnt[4].y) div DT;
      if BC >= 255 then d := -1;
      if BC <= 0   then d := 1;
      BC := BC + d * 5;
      Col := RGB( BC, GC, BC);
      Canvas.Pen.Color   := Col;
      Canvas.Brush.Color := Col;
      Canvas.Polygon( Pnt);
    end;
  if IC >= 255 then begin Id := 1; end;
  if IC <= 0 then begin Id := -1;  end;
  IC := IC - id * 5;
  end;
end;
 
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  RotateRect;
end;
 
end.

Прикрепленный файлРазмер
Исходные коды и исполняемый файл215.1 кб