I am trying to walk a line that is intersecting a mesh, and given the point on the line I need to see what vertices may be perpendicular to it. My initial idea was to attempt a dot product between the line's direction vector and the direction vector from the point on the line to the mesh's vertex, and then only accept values that were near 0. This resulted in a collection of vertices behind the point on my line. Playing with the threshold values for the dot product check do not seem to help either. Any ideas?
Code
//actual_pos = position of the vertex
//trav_in_soace = point along the line
//m_fireDir = normalized direction vector of the line
Vector3 dir_to_point = actual_pos - trav_in_space;
dir_to_point.Normalize();
float dot_accept = DotProduct(m_fireDir, dir_to_point);
if (dot_accept > max_threshold || dot_accept < min_threshold)
continue;
Picture with threshold values near 0.5
This is best result I can get and it is still really inaccurate. The orange verts are the points on the purple line, the red and blue are what should be the desired vertices.