Play And Games VR Development Dairy

An exploration of wonders and challanges of VR development.

Creating a Map Table

Working of the well researched and standardised controls of most hand-held touch screen devices, there are three main features of the map that needs to be implemented, the scrolling, zooming and rotating of the map.

Lets have a look at some pseudo-code for each of the three input methods.

public variable deadZone; public variable scrollMultiplier; public variable zoomMultiplier; public variable rotateMultiplier;

private variable previousLeftPositions; private variable currentLeftPositions; private variable previousRightPositions; private variable currentRightPositions;

Update() { variable delta = findDeltaBetweenPreviousAndCurrentPositions();

if (numberOfTriggersPressed == 1)
{
    scrolling()
    {  
        if (delta > deadZone)
        {
          updatePositionBy(delta * scrollMultiplier);
        }
    }
}
else if (numberOfTriggersPressed == 2)
{
    zooming()
    {
      if (delta > deadZone)
      {
          zoomBy(+delta);
      }
      else if (delta < deadZone)
      {
          zoomBy(-delta);
      }
    }
    rotating()
    {
        // this is going to need a special section of its own
    }
} }

Of course, iteration is key to development so there is plenty of room for updates and improvements. Smoothness is key to these features, luckily there is plenty of research on the smoothness of touch controls for hand-held devices like smartphones and tablets as explained earlier.

Look! Testing may not be the most stylish but its important. picture

Back to Main Page