You will need a knowledge of an entire multiture of things, but ordered by importancy:
1- linear algebra knowledge (finding triagnle intersection of a geometry in object space, moving to world spcace, AABS intersection by ray in world space,...)
2- geometry data understanding - (indexing verticies, examining triangle composed,...)
I do not know a book about linear algebra, but I would google for vector operations on wiki . Aligning an object onto a pointed triangle-surface will require you to master linear algebra quite much. You will have to fetch a normal unit vector and compute rotation transformation matrix to apply into snaped object world matrix upon this vector. A single offset of object would be simple increae of position in an axis direction, increasing it in surface direction would require to add vector normal to the surface to the position vector.
There are basic linear algebra termins I will write out for you to inspect and search more easily:
1- vector (n dimnension )
2- vector space
3- vector space basis vectors
4- transformation of vector
5- unit vector, vector length, scalar
6- operations with vectors: adding vectors, subtracting vectors, dot product of 2 vectors, cross product of 2 vectors, multiplying a vector by scalar, normalizing a vector, inverse vector, orthogonal vector, vector multiplication by matrix
7- transformations- matrix multiplication by matrix, inverse matrix, determinant, nxm matrix, transposing, adding matricies, subtracting matricies, orthogonal matrix, orthonormal matrix