Went through the ViveSpray stream and loved it and was able to get it to work. I would like to achieve something similar but with a whiteboard and marker. Thought about just taking the distance of return on the ray to something really small, but the marker that would be held would need to be at an angle to be “correct”. So that would make registering the mark with the tip of the marker an issue. So 2 questions really:
Could this same ViveSpray effect be called on collision, so that it “sprayed” when the tip of the marker collided with the mesh it was writing on?
Is there a way to angle the ray being cast so that I could line it up with the angle my marker was being held at?
thanks in advance for any help.
Good question! You are on the right track with the first question. I would look into the Unity OnCollisionEnter(Collision) This will let you detect when the pen collides with something like a white board. At this point, you could start drawing on the material. You could then couple this with OnCollisionExit in order to detect when the pen is not touching the white board.
This should also help avoid the angle problem since the angle the user holds the pen is based on whatever feels natural to them.