unit GLUnit;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  GLScene, GLObjects, GLMisc, GLWin32Viewer;

type
  TGLForm = class(TForm)
    GLViewer: TGLSceneViewer;
    GLScene1: TGLScene;
    GLCamera1: TGLCamera;
    DummyCube1: TDummyCube;
    GLLightSource1: TGLLightSource;
    Plane1: TPlane;
    Sphere1: TSphere;
    ArrowLine1: TArrowLine;
    DummyCube2: TDummyCube;
    procedure GLViewerMouseDown(Sender: TObject;
      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    procedure GLViewerMouseMove(Sender: TObject; Shift: TShiftState;
      X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  GLForm: TGLForm;
  mx,my : integer;
implementation

{$R *.DFM}

procedure TGLForm.GLViewerMouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 mx:=x; my:=y;
end;

procedure TGLForm.GLViewerMouseMove(Sender: TObject;
  Shift: TShiftState; X, Y: Integer);
begin
  if ssLeft in Shift then begin
     GLCamera1.MoveAroundTarget( (my-y)/5, (mx-x)/5 );//вращение камеры
     mx:=x; my:=y;
  end;  
end;

end.
