Spot on Texture

Blitz3D Forums/Blitz3D Programming/Spot on Texture

Yes, got it and after some trial and error came up with this, which should work for you provided you are not using loadermatrix() or otherwise changing the physical mesh. Once I got the texture moving in the right direction and correctly centred, with a texture scale of 1, I then decreased the scale to 0.5 and then 0.25 and worked out how to calculate the offsets after applying them manually. Consequently there may well be a more elegant way of expressing this.

TFormPoint posx,0,posz,0,terrain ; also need to specify posy if your terrain is pitched or rolled.
PositionTexture texture,(0.5/uscale-0.5)+(-TFormedX()/(32*uscale)),(0.5/vscale-0.5)+(-TFormedZ()/(32*vscale))

terrain is your land mesh, uscale and vscale are the texture scales. Your mesh is 32x32 in x/z extending from -16 to +16 with uvs in the range 0..1 hence the use of 32 above multiplied by texture scale which gets the tformed coords in the right ballpark.