eine Möglichkeit wäre noch
Delphi-Quellcode:
private
{ Private-Deklarationen }
picked_object:TGlBaseSceneObject;
Delphi-Quellcode:
procedure TForm39.GLSceneViewer1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
picked_object:=GLSceneViewer1.Buffer.GetPickedObject(X,Y);
end;
procedure TForm39.GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var pp:TVector3f;
begin
if (Assigned(picked_object)) and (Shift=[ssRight]) then begin
pp:=GLSceneViewer1.Buffer.ScreenToWorld(x,y);
picked_object.Position.x:=pp.x;
picked_object.Position.y:=pp.y;
end;
end;
procedure TForm39.GLSceneViewer1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
picked_object:=nil;
end;
end.