ThePentiumGuy
Well-known member
Are Lights Transformed Or Not?
pent
pent
For i = 0 To blgrid.GetUpperBound(0)
For i2 = 0 To blgrid.GetUpperBound(1)
If blgrid(i, i2).Exsists Then
D3d.Device.Transform.World = D3d.Translate(blgrid(i, i2).pos.X, blgrid(i, i2).Alt, blgrid(i, i2).pos.Y)
v3dmouse = Vector3.Subtract(D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, -100)), D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, 100)))
If modBattle.GridTopMesh.Intersect(D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, -100)), v3dmouse) Then
BLP.x = i
BLP.y = i2
Exit Sub
End If
End If
Next
Next
rifter1818 said:However the following worked for using a single (150x150x0) square mesh to check the tops of a (3x150)x(2x150) landscape.
rifter1818 said:Code:[/size] [size=1] [/size] [size=1]For i = 0 To blgrid.GetUpperBound(0)[/size] [size=1]For i2 = 0 To blgrid.GetUpperBound(1)[/size] [size=1]If blgrid(i, i2).Exsists Then[/size] [size=1]D3d.Device.Transform.World = D3d.Translate(blgrid(i, i2).pos.X, blgrid(i, i2).Alt, blgrid(i, i2).pos.Y)[/size] [size=1]v3dmouse = Vector3.Subtract(D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, -100)), D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, 100)))[/size] [size=1]If modBattle.GridTopMesh.Intersect(D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, -100)), v3dmouse) Then[/size] [size=1]BLP.x = i[/size] [size=1]BLP.y = i2[/size] [size=1]Exit Sub[/size] [size=1]End If[/size] [size=1]End If[/size] [size=1]Next[/size] [size=1]Next[/size] [size=1]