Calculate intersection between 3d object and line of sight?

You have to use the determinant, not at my computer though so i cannot pull up a resource. Its really just about using either a matrix multiplier, to obtain the determinant or use the general formula to calculate the line intersection, this will sometimes be available on wikipedia, and is the formula specifically for calculating, that type of line intersection. If you want to get a feel for this type of program, you could check out, Dan Shiffmans recent coding challenge, where he made a ray caster, same sort of problem but with one dimension less (he would cast lines from a point and check if they had intersected another line), maybe an alternative would be one function to check the x component and another to check the y component, in 3d space.

http://geomalgorithms.com/a05-_intersect-1.html

https://rosettacode.org/wiki/Find_the_intersection_of_a_line_with_a_plane

this last one is very good, as it has examples in multiple programming languages.

2 Likes