If I understand your question correctly, and assuming your plane is at 0,0,0 with a normal of 0,1,0, here's a snippet demonstrating one way to do it. This is in Tier1, but I doubt it'd be hard to translate to Tier2.
SetSyncRate(60,0)
// setup a simple scene
groundObj = CreateObjectPlane(512,512)
RotateObjectGlobalX(groundObj,90)
SetObjectColor(groundObj,100,100,100,255)
obj = CreateObjectSphere(16,16,16)
SetCameraPosition(1,0,32,0)
do
// Move camera with WASD
// Rotate Camera with Arrow Keys
MoveCameraLocalX(1,GetRawKeyState(68) - GetRawKeyState(65))
MoveCameraLocalZ(1,GetRawKeyState(87) - GetRawKeyState(83))
RotateCameraGlobalY(1,GetRawKeyState(39) - GetRawKeyState(37))
RotateCameraLocalX(1,GetRawKeyState(40) - GetRawKeyState(38))
cx# = GetCameraX(1)
cy# = GetCameraY(1)
cz# = GetCameraZ(1)
pxRaw# = Get3DVectorXFromScreen(GetPointerX(),GetPointerY())
pyRaw# = Get3DVectorYFromScreen(GetPointerX(),GetPointerY())
pzRaw# = Get3DVectorZFromScreen(GetPointerX(),GetPointerY())
// get pointer vector y added to camera's y position
pyRelative# = pyRaw# + cy#
// find distance between camera's y position and pyRelative#
dist# = cy# - pyRelative#
// calculate scaling value by finding how many times dist# goes into the camera's y position
s# = cy# / dist#
// find the intersection point by multiplying pointer vector by s# and adding it to the camera position.
// ignoring Y in this case since it should be 0 anyway.
ix# = cx# + pxRaw# * s#
iz# = cz# + pzRaw# * s#
// position the object at the intersection point
SetObjectPosition(obj,ix#, 0, iz#)
print("Move camera with WASD, rotate camera with Arrow Keys")
print("")
print(ScreenFPS())
sync()
loop
If your plane has a different normal or position, it'd be a bit more complicated.