Today just about wraps up the prototyping; all the work I had done so far was on single-touch based prototypes (sans the pinch zoom) but I decided to do one last part for multi-touch input.
The system is simple this time around; one must touch both sides of the laser gun line to transport it to a different location. I was already familiar with the Line Renderer, so the only tricky part was the actual gun pieces. They needed to rotate toward each other, but as 3D pictures in space, it was their up vectors that needed to face each other. Lo and behold, LookRotation was my answer. LookRotation is a method in Unity's Quaternion class that takes a forward and up vector and makes a proper rotation. The gun was already facing the camera, so the up vector just needed to face the direction of the other gun.
I also managed a transparency on the shader for some useful visuals for touch input; if only one gun is touched, the laser will be half-faded to note the change.
What next? Sleep; then an actual prototype!
No comments:
Post a Comment