You don't know the XYZ coordinate system?
Think about this.
Stand straight, staring straight ahead. Your left and right hands-that's the X axis - width
Now, up and down, this is the y axis - height
stare straight infront of you, this is the z axis - depth
Mind you Unlike your left and right hands, x,y, and z, are definite, not relative to your rotation
As for the script to get 3d coordinates?
null = make vector3(1)
null = make vector3(2)
null = make vector3(3)
null = make vector3(4)
set vector3 1, 0, -1, 0
pick screen mousex(), mousey(), 1
x# = get pick vector x()
y# = get pick vector y()
z# = get pick vector z()
set vector3 2, x#, y#, z#
angle# = acos(dot product vector3(2, 1))
cos_angle# = cos(angle#)
hypo_length# = camera_y / cos_angle#
normalize vector3 2, 2
scale vector3 2, 2, hypo_length#
set vector3 1, camera_x, camera_y, camera_z
add vector3 4, 1, 2
null = delete vector(1)
null = delete vector(2)
null = delete vector(3)
First, what happens is, the program makes four vectors to use, a vector is a 3d coordinate <x,y,z>
It sets vector 1 as a normalized vector pointing straight down.
Then it takes the 3d coordinates of the mouse. Technically it's not quite accurate, it takes the 3d position of the mouse, projected one unit into the screen.
Then it gets the three coordinates (x#,y#,z#)
then, it sets the second vector as those 3d coordinates <x#,y#,z#>
Then, It finds the angle of a line - if there were to be a line projected from vector 1 to vector 2 - by finding the arcossine of the dot product of the two vectors, read the tutorial "Vectors don't bite!" for a better explanation
Then, it takes that angle, and finds the cosine of it.
With this, you can find the length of the hypotenuse, from the camera, to a 2d plane at <0,0,0>
Now, it takes the normalized version of the second vector, and scales it by the length of the hypotenuse. After whitch it reuses vector 1, setting it to the x position of the camera, the y position of the camera, and the z position of the camera, and adds that to the scaled vector...
AAAAnd there you go, you have the 3d projection of the line onto a 2d plane. I dunno what to do if you want a 3d terrain though.... good luck
parrot