Blue marble lazarus / 8-Other ---------------------------------------------------------------------- Arminius · 2009-05-09 19:33 Hello, I started developping a widget using Lazarus, inspired by the 'blue marble' widget on earth. It is a rotating model of earth by night. Unfortunatly, for some reason I don't understand, it's not doing what it should following the source code. Might this be a bug? Following the source code, earth should be rotating in one direction, but in the exe, it zooms in and out. Followind the source code, moving the mouse up and down when pressing the right mouse button should zoom in and out, but it doesn't. Here is my code: Code: [Select]unit Main; {$mode objfpc}{$H+} interface uses   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, glscene,   glwin32viewer, ExtCtrls; type   { TForm1 }   TForm1 = class(TForm)     GLCamera1: TGLCamera;     GLLightSource1: TGLLightSource;     GLScene1: TGLScene;     GLSceneViewer1: TGLSceneViewer;     //GLSphere1: TGLSphere;     Timer1: TTimer;     procedure FormCreate(Sender: TObject);     procedure FormResize(Sender: TObject);     procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState; X,       Y: Integer);     procedure Timer1Timer(Sender: TObject);   private     { private declarations }     mx,my:integer;   public     { public declarations }   end; var   Form1: TForm1; implementation { TForm1 } procedure TForm1.GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;   X, Y: Integer); begin   if [ssleft] = shift then begin   GLCamera1.MoveAroundTarget(my-y, mx-x);   end   else if [ssright] = shift then begin   if y> my then GlCamera1.Position.Z := GlCamera1.Position.Z +0.1   else if y< my then GlCamera1.Position.Z := GlCamera1.Position.Z -0.1;   end;     mx := x;   my := y; end; procedure TForm1.Timer1Timer(Sender: TObject); begin GlCamera1.Position.X := GlCamera1.Position.X -0.1; end; procedure TForm1.FormResize(Sender: TObject); begin   GLSceneViewer1.Height:=Form1.Height;   GlSceneViewer1.Width:=Form1.Width; end; procedure TForm1.FormCreate(Sender: TObject); begin   GLSceneViewer1.Left:=0;   GLSceneViewer1.Top:=0; end; initialization   {$I main.lrs} end.