Posted: 12th Nov 2003 23:37
I wrote this down during my systems analysis class. So I don't have a way of testing it, but I think it'll work.

Remember, I said I THINK this will work. I made this before for a snowboard game I never finished, but it was maybe 2 years ago. So if this doesn't work, I'll dig it up and post something thats accurate.

+ Code Snippet
rem a-e-b
rem |   |
rem g   h
rem |   |
rem c-f-d


size# = 50
make object plain 1, size#,size#

randomize timer()
make matrix 1, 1000,1000,30,30
randomize matrix 1, 100
update matrix 1

rem Plane is assumed its a square (even length and width)
rem points A,B,C,D are the 4 corners of the plane.
rem E,F,G,H are midpoints

DO
  a.x=x#-(size#/2)
  a.z=z#+(size#/2)
  a.y=get ground height(1,a.x,a.z)

  b.x=x#+(size#/2)
  b.z=z#+(size#/2)
  b.y=get ground height(1,b.x,b.z)

  c.x=x#-(size#/2)
  c.z=z#-(size#/2)
  c.y=get ground height(1,c.x,c.z)

  d.x=x#+(size#/2)
  d.z=z#-(size#/2)
  d.y=get ground height(1,d.x,d.z)

  e.y=(a.y+b.y)/2
  f.y=(c.y+d.y)/2
  f.y=(a.y+c.y)/2
  g.y=(b.y+d.y)/2
 
  y#=(e.y+f.y+g.y+h.y)/4
  anglex#=xangle(e.y, f.y,size#)
  anglez#=zangle(g.y, h.y, size#)

  position object 1,x#,y#,z#
  rotate object 1,anglex#,0,anglez#

  sync
LOOP

function xangle(mid_e#, mid_f#, size#)
  xang# = asin(mid_e# - mid_f# / size#)
endfunction xang#

function zangle(mid_g#, mid_h#, size#)
  zang# = asin(mid_g# - mid_h# / size#)
endfunction zang#
Posted: 13th Nov 2003 1:22
well i'm home and i tested it. doesn't work one bit!
Posted: 13th Nov 2003 1:54
The below code is the snowboard game that I never finished. As it hardly has anything more than movement, you can easily see what's done. The snowboard its self is glued to a dummy object. The cube on top of the board would represent a person standing on it. The board can also slide down the slope. This works in both DBC and DBP. Though for DBC, you may want to change the matrix tile amount to x50 and z100. If you change that, dont forget to change the values for the FOR loops for calculating the matrix normals.

(matrix normal code made by LEE BAMBER)