   i must be missing something
  this is the  function i use to get the rays intersection point.  it''s just the functions from the book OpenGl Game Programming.// return the distance of point to the planeconst double inline DistanceToPlane(const CVector& point) const{return N % point + D;}// return the intersection point of the ray to this planeconst CVector inline RayIntersection(const CVector& rayPos, const CVector& rayDir) const{const double a = N % rayDir;if (a == 0)  return rayPos;// ray is parallel to planereturn rayPos - rayDir * (DistanceToPlane(rayPos) / a);}Now I want to see what below the player.  Would that be a direction vector like this x0 y-1 z0.Cause that what i''ve been doing and it''s says it parrallel to the plane when the planes normal is x0 y1 z0.  Can anyone help? 
  rayDir = (0, -1, 0)looking down the Y axis;  yeah that''s what i''m doing maybe it''s to do with my other code.  but it''s giving me the right values for the normals.  does the rayPos vector need to be normalised or something? ;  someone must have some idea why it's not working.  also when i have a raydir = (-1,0,0) it returns an intersection point as if the plane had a normal of (1,0,0) which is weird.  also here the bit i use to determine what triangle the player is in.  can anyone see anything wrong with that?  the printing to a file is just to check why it's not working.// Return the height of the terrain at the points passed to it.// Throws an error if points are outside terrain bordersdouble CTerrain::GetHeight(double XPoint, double ZPoint){if(NoVertexX == 0 || NoVertexZ == 0)return 0.0;if (XPoint < 0 || XPoint > NoVertexX)return 0.0;if (ZPoint < 0 || ZPoint > NoVertexZ)return 0.0;CVector VecHeight;double Height=0;CPlane *Plane;// Round off decimalsint X =(int) XPoint;int Z =(int) ZPoint;// Get the position in the current squaredouble dX = XPoint - (int) XPoint;double dZ = ZPoint - (int) ZPoint;// Work out what square the player is inint PX = Z*NoVertexX + X + 1;// Work out distancedouble dX1 = 1 - dX;double dZ1 = 1 - dZ;// Get distance to each corner vertex to see what triangle it's indouble Distance1 = sqrt((dX*dX)+(dZ*dZ));double Distance2 = sqrt((dX1*dX1)+(dZ1*dZ1));// Get the heights of the three vertexesdouble Height1 = VertexData[PX][1];double Height2 = VertexData[PX+1][1];double Height3 = VertexData[PX+NoVertexX][1];// Get that triangles planePlane = new CPlane(CVector(1,Height2,0),CVector(0,Height1,0),CVector(0,Height3,1));VecHeight = Plane->RayIntersection(CVector(dX,6,dZ),CVector(0,-1,0));ofstream file("Test.txt");file <file <file <file <file <file <N.x<file <N.y<file <N.z<file <file <file <file.close();delete Plane;Plane = NULL;return Height;}   [edited by - hello_there on February 10, 2004 8:03:49 PM];  i gather no reply mean nothing wrong.  which means i''m shit out of luck.   damn ;  unless there''s something wrong with this// dot productconst scalar_t operator%(const CVector &vec) const{return x*vec.y + y*vec.x + z*vec.z;} ;  yes thats wrong.x.vec.x + y*vec.y + .. ;  omg it's working thanks so much.Also that bit i got that checks the distances to the corner of the triangles that would work in telling me what triangle the player is in right?   [edited by - hello_there on February 12, 2004 7:36:03 PM];  oh great it works on a flat surface and a constant rise but doesn''t work on random terrain.  anyone know why this might be? ;  What is it doing that it is not working?   --------------------------------------I am the master of stories.....If only I could just write them down... 