top of page

AR pool

Platform

Windows

Language

C++

Project Type

Course Work

Role

Solo

Duration

~3 Months

As part of the Applied Game Technologies module, we were tasked to create a game application that specifically exploits the features of the PS Vita and its AR technologies.

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

Untitled Diagram.png

The first step in the game is to build the table, this uses between 3 to 6 markers. When the Vita finds a marker its information, such as its transform, if it is visible, and its ID number, is stored in a struct. To make sure the rest of the objects in the game are positioned correctly in relation to the markers, the visible marker with the lowest ID is chosen as the local origin point. All the marker’s positions relative to this point are then calculated and stored in the before mentioned struct.

The next main step is to order the markers into a useful format, as at this point they are ordered by their ID number, which would produce a less than ideal pool table (shown below).

shit table.png

To do this the midpoint of the markers is calculated from the mean of their positions. This is then used to calculate the angle the markers are around this midpoint, shown below.

 â€‹

angles.png

The angle that is calculated is again stored in the marker struct and the visible markers are then added to a vector. This vector is then used to sort the markers into clockwise order, using bubble sorting based in their calculated angle. Each marker then gets paired with the next one in this new order, apart from the last marker which gets paired with the first, thus allowing the walls of the pool table to be set up. Each wall is first created as a cube and positioned at the midpoint of two of the markers, scaled down to a constant size (A). The distance between the two markers is then calculated, as is the angle the markers make (B), the cubes y scale the gets set to this distance and it gets rotated by this angle (C).

calc.png

This process is done every frame allowing the user to see how the table will look as they move around the various markers.

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

 

When the user presses the X button the local origin is then changed to the marker with the lowest ID. To do this the position of each marker, relative to the midpoint, is then calculated. The walls are then set up again, but the midpoint offset is then applied to the marker with the lowest ID causing the walls to surround this marker, this is shown below.

​

​

​

​

​

​

​

​

​

​

​

​

​

​

The walls positions are no longer recalculated each frame, the final setup of the table is now reached.

​

​

​

​

​

final.png
offset.PNG

©2018 by Andrew Milne. Proudly created with Wix.com

bottom of page