reflecting around a vector
The above image hopefully explains the line below marked as "the reflecting bit". In the code below, in Kodelife branded code, I'm assigning the mouse.x to define the angle value, multiplying it by PI to get a full range of rotation (not sure why it's not 2 PI here, will update when I figure it out) Firstly, toward the bottom of the code, we're defining the distance from a line that goes from 0, to 0.5 on the x axis. We then use the smoothstep function on the distance variable to draw a thin line. We actually rotate the line by reflecting it across a vector n, whose direction we define by the angle. The dot product dot(uv,n) gives us the distance from the n line. and the direction we want to move in is n. so multiplying n by the distance and by 2 will get us toward the line and across. a slight maths aside. dot(uv,n) *n is the actual projection of uv onto n. the above image is dealing with a normalised vector, where n would be 1 and isn't included in the eq...