Posts: 193
Threads: 20
Joined: Jun 2005
Ok, hmm...Which method would be the simplest of making an object just walk smoothly over terrain?
Posts: 3,288
Threads: 167
Joined: Nov 2001
Posts: 193
Threads: 20
Joined: Jun 2005
I see.
Well, how would I do this sphere to poly collision detection? Im a complete newb to collision detection
Thanks for your help. 8)
Posts: 3,288
Threads: 167
Joined: Nov 2001
I just read tutes on the net. If you can find the collision detection part of gametutorials.com, it would be swell (they're a pay site now but I believe doc dav had Dled some of it. Mine got lost with my HD).
Posts: 140
Threads: 13
Joined: Apr 2005
Quote:d.j.peters Wrote:I hope this can help.
http://nehe.gamedev.net/data/articles/ar...article=10
Joshy
Dj that would work (Geometry "sum of exterior angles of any poly = 360) but that is arse slow. What I and doc_dav use does not use any trig funk, but uses the only the dot product, very fast and effecient. It's in blackpawn's page.
Blue, nope, what we do is calculate intersections of planes and spheres. :*)
http://www.cs.unc.edu/~geom/collide/packages.html
Joshy
sorry about my english
Posts: 5
Threads: 0
Joined: Mar 2006
Assuming that the triangles form a grid which is aligned with X,Y
and that Z is height
Code:
type vertex
x as single
y as single
z as single
end type
' a--b
' \ |
' \|
' c
' or
' c
' |\
' | \
' a--b
function subV(a as vertex,b as vertex) as vertex
subV.x=a.x-b.x: subV.y=a.y-b.y: subV.z=a.z-b.z:
end function
function scaleV(x as single,a as vertex) as vertex
scaleV.x=a.x*x: scaleV.y=a.y*x: scaleV.z=a.z*x:
end function
function height(p as vertex,a as vertex,b as vertex,c as vertex) as single
dim d as vertex
dim t as single
' vector a->b scaled so that x = 1
d=subV(b,a) : d=scaleV(1/d.x ,d)
' height at edge point with matching x
t= a.x+ d.z*(p.x-a.x)
' vector b->c scaled so that y = 1
d=subV(c,b) : d=scaleV(1/d.y ,d)
hieght = t + d.z*(p.y-b.y)
end function
Posts: 193
Threads: 20
Joined: Jun 2005
Thanks DirkFist!
Posts: 5
Threads: 0
Joined: Mar 2006