how could move an object under the mouse on a 3d plane?
the complete simple project is on
http://www.geocities.com/cannellag/opengl.zip
the procedure for move object in main.pas is:
procedure TFormOpengl.GLSceneViewer1MouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
begin
if ssLeft in Shift then begin
if clicc then
begin
car.Position.x:=x*sin(GLCamera1.LocalMatrix[3,2]/GLCamera1.LocalMatrix[3,0])/5;
car.Position.z:=y*cos(GLCamera1.LocalMatrix[3,2]/GLCamera1.LocalMatrix[3,0])/5;
end
else
mx2:=x; my2:=y;
end;
end;
thank
|
|
0
|
|
|
|
Reply
|
cannella72 (1)
|
7/24/2003 6:59:39 PM |
|