Since the object will be changing frequently the following line is added to notify Vizard of this and speed up rendering:
Now, add the following function which draws a new vertex and updates the line strip when the user has changed position:
Run the code and see how the viewpoint path is updated as you navigate through the maze.
Finally, add the following code so that each time the spacebar is pressed the viewpoint path will be cleared. The <node3d:onthefly>.clearVertices command will remove all the vertices of the lines object so that a new path can be drawn from that point on: