I want to make a program functionally similar to WorldEdit's normal cuboid selector (because the poly or spheroid selector is far beyond my ability) but I need to know how to use the normalized direction vector from a player (ent.getLooking(x, y, z) returns it) to find out what block the player is looking at. From what I understand, what needs to be done is:
1) Extend out the vector linearly. (This is where I have a problem!)
2) Detect all blocks within that line. (This is trivial if I can get the co-ords)
3) If the line hits a block, end it (break or return)
So, does anyone with more knowledge than me about vectors know how that would be written?
(And if anyone wants to help me in programming this, I would love to see how someone who's a better coder than me could do it)
Edited by moomoomoo309, 20 January 2014 - 12:31 PM.












