Quote: "I'm assuming that if the object was REALLY big it wouldn't work"
No, the way you set the distance equation up, it is finding the distance to a point in space about half the width of the object in front of it.
To see what i mean, change this:
Position Camera NewXValue(x#,a#,-200),110,NewZValue(z#,a#,-200)
To this:
Position Camera NewXValue(x#,0,-200),110,NewZValue(z#,0,-200)
And make the cross-hairs collide with an object so you can see it side-on... You'll notice that the cross-hairs come out, far infront of the object therefore not really poisitioning it where it should be (although, it does look alright)
Hmm, for the matrix collision, you could try:
Sync On : Sync Rate 0
`Makes a scene with random objects.
Make Matrix 1,2000,2000,10,10
Set Matrix Height 1,0,0,200
Set Matrix Height 1,0,1,200
Set Matrix Height 1,1,1,200
Set Matrix Height 1,1,0,200
Update Matrix 1
For x = 2 To 11
Make Object Cube x,x*Rnd(10)
Position Object x,Rnd(2000),(Object Size(x)/2),Rnd(2000)
Color Object x,RGB(Rnd(255),Rnd(255),Rnd(255))
Next x
`The crosshair's object number would be 100, the characters would be 1
Make Object Sphere 1,50
Make Object Plain 100,10,10
Make Object Plain 101,300,10
`This makes the crosshairs face you.
Yrotate Object 100,90
Fix object pivot 100
Fix object pivot 101
Hide Object 101
Sync
Do
`This finds how high off of the matrix the cross-hairs are.
matrix_crosshair_y# = Object Position Y(100) - Get Ground Height(1,Object Position X(100),Object Position Z(100))
Set Cursor 0,0
Print "How high the croos-hairs are in relation to the matrix ";matrix_crosshair_y#
`Finds the height of the matrix at the position of the character object.
y# = Get Ground Height(1,x#,z#)
Position Object 1,x#,y# + 25,z#
Set Object To Object Orientation 100,1
Set Object To Object Orientation 101,1
YRotate Object 100,WrapValue(a#-90)
YRotate Object 101,WrapValue(a#-90)
`This positions the crosshair at 100 units from the character
Position Object 100,NewXValue(x#,a#,dist#),y# + 25,NewZValue(z#,a#,dist#)
`Positions the plain that is at right-angles to the character
Position Object 101,NewXValue(x#,a#,150),y# + 25,NewZValue(z#,a#,150)
`This is the right-angled plain collision.
obj_hit_num = Object Collision(101,0)
If obj_hit_num > 0 And obj_hit_num <> 1 And obj_hit_num <> 100
crossx# = Object Position X(obj_hit_num)
crossy# = Object Position Y(obj_hit_num)
crossz# = Object Position Z(obj_hit_num)
dist# = ((crossx# - x#)^2 + (crossy#+50 - y#)^2 + (crossz# - z#)^2)^0.5 - Object Size(obj_hit_num)
Else
`This handles the matrix collision (doesn't work yet)
If matrix_crosshair_y# <= 10 And mat_hit = 0
crossx# = Object Position X(100)
crossz# = Object Position Z(100)
dist# = ((crossx# - x#)^2 + (crossz# - z#)^2)^0.5
mat_hit = 1
Else
If matrix_crosshair_y# > 10 Then dist# = 300 : mat_hit = 0
EndIf
EndIf
`Simple Movement controls
If Upkey()=1 Then x#=NewXValue(x#,a#,6) : z#=NewZValue(z#,a#,6)
If Downkey()=1 Then x#=NewXValue(x#,a#,-4) : z#=NewZValue(z#,a#,-4)
If Leftkey()=1 Then a#=WrapValue(a#-3)
If Rightkey()=1 Then a#=WrapValue(a#+3)
`Camera control.
Position Camera NewXValue(x#,a#,-200),y# + 100,NewZValue(z#,a#,-200)
Point Camera x#,y#,z#
Sync
Loop
But, atm, i can't get it to work properly!!
That's the basic structure that you'll need (i think) so if you can get it working then good on ya!.
Quote: "I found a way to check an object distance from the matrix. As soon as I get back home, I'll show you a snippet. However, if I use that method I'd have to increment the distance of the crosshair by tiny increments until either collision with the matrix happens, or the max_distance is reached. That could be quite a waste of memory come to think of it..."
I'm not too sure what you mean by this, but if it's a different approach to the problem than mine, then I'll be happy to see it
[EDIT]If you set-up your floor etc as objects and planes etc, then you wouldn't have to worry about the matrix intersection etc...[/EDIT]

Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy