Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculating height INSIDE 3d triangles
#11
Ok, hmm...Which method would be the simplest of making an object just walk smoothly over terrain?
It's the difference between asking someone how much flour goes into pancakes, and handing them a sorry mix of oozing green goo and asking them to fix it." - Deleter

-Founder & President of the No More Religion Threads movement-
Reply
#12
Sphere to poly. :*)
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#13
I see.

Well, how would I do this sphere to poly collision detection? Im a complete newb to collision detection Sad

Thanks for your help. 8)
It's the difference between asking someone how much flour goes into pancakes, and handing them a sorry mix of oozing green goo and asking them to fix it." - Deleter

-Founder & President of the No More Religion Threads movement-
Reply
#14
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).
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#15
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
Reply
#16
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
Reply
#17
Thanks DirkFist! Smile
It's the difference between asking someone how much flour goes into pancakes, and handing them a sorry mix of oozing green goo and asking them to fix it." - Deleter

-Founder & President of the No More Religion Threads movement-
Reply
#18
Your welcome :bounce:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)