I am trying to learn the correct way to manipulate objects in world space. As a test I have created a cube and I am drawing some lines from an arbitrary vector to each vertex on the cube.
If I don’t change the cube in any way then the lines hit the vertices nicely:

but if I rotate the cube, then the lines no longer match the vertices:

Obviously I know I could rotate the line by the same amount as I am rotating the cube, but I know I should be manipulating matrices or vectors to do this.
Can anyone explain how I should be approaching common issues like this, without needing to rotate both objects.
For convenience I have a jsfiddle to play with
If you want the lines to rotate with the code you just need to add the line to the cube instead of to the scene:
However, if what you want is to keep the origin of the lines at the same position and update the end of the lines instead.