Keywords

1 Introduction

With apprehensive application of computer graphics technology, artificial intelligence technology, multimedia technology, network and communication technology, games are an important part of modern forms of entertainment. Game development involves traditional games, online games and virtual reality games in terms of design philosophy, and it also goes through stages from 2D to 3D technically. The development and attention given to the new technology in the field of online games, especially to 3D display technology, have promoted the rapid development of game industry. Facing prominent contradictions between the focus on interaction and the lack of recreation, virtual reality games appeared. Virtual reality sublimates audio-visual experience to body experience, which enables users to be involved physically and to fully experience the joy brought by games. Responding to the focus on the user’s experience in virtual reality games and based on the virtual reality technology, the article develops a basketball game with the rules that users can gain points by passing levels. The game not only combines entertainment with education, but also increases the fun of the game through the augmented reality technology.

2 Related Works

Augmented reality (AR) constructs a virtual space with a virtual-real combination by overlaying computer-generated virtual objects [1], scene or information suggested by system on the real scene, which realizes the augmentation of the real world [24]. The rise of small hand-held mobile devices (such as palm computer PDA and smart phones) provides a new technical method for the development of mobile augmented reality system [5, 6]. Most of the current mainstream mobile handheld devices have built-in megapixel camera and integrate high-speed wireless communication network equipment such as infrared communication interface, Bluetooth wireless interface and wireless LAN card [7, 8]. Choosing small handheld mobile devices as a new carrier of augmented reality technology has a strong advantage in aspects of mobility, portability and human-computer interaction. It has become an inevitable trend of the new generation AR technology to take smart phones as AR technology development and application platform [912]. Game development in AR system mainly deals with mobile video detection technology and virtual-real registration technology. The mainstream motion detection methods are optical flow method [1315], background difference method [16] and interframe difference method [17]. AR virtual-real registration technology [18, 19] mainly includes: reference point method, template matching method, affine transformation method and the method based on image sequence. In template matching registration technology, augmented reality system is based on feature points whose accurate identification is the key to the virtuality and reality combination.

3 Game Development of Augment Reality Based on Smart Phone

Augmented reality game system is composed of a number of hardware and software. In order to simplify the design process, the entire augmented reality system is divided into four subsystems: image acquisition, feature recognition, scene generation and display enhancements. As is shown in the figure below, the mobile phone camera belongs to the image collection subsystem, feature recognition and feature tracking units belong to the feature identification subsystem, scenario generation computing cell belongs to the scenario generation subsystem, image synthesis computing cell and mobile terminal belong to display enhancement subsystem.

Users turn on cell phone cameras to obtain video frame. The system will identify video frame data firstly. Then it will match video frame data, and track the video. At last, the video is overlaid with corresponding registered virtual scenes and then send it to the user terminal to display. In the whole design phase, virtual scene is generated by modeling and animation units, and AR games are implemented by game element synthesizing and game production units, as is shown in Fig. 1.

Fig. 1.
figure 1

System structure design drawing

3.1 Construct Model

The steps of creating model based on 3Dmax

  • Step1: Design the original painting

  • Step2: Tpose model building

  • Step3: Break up the UV map

  • Step4: Draw the UV map

  • Step5: Adjust the material

  • Step6: attach texture onto material

According to the modeling method mentioned above, three models are built in the virtual reality game system: half a basketball court, a basketball board, a bind bones basketball figure, as is shown in the figure below (see Fig. 2).

Fig. 2.
figure 2

Set up the virtual model

3.2 Animation Production

In the development of augmented reality game, animation includes waiting animation, dribble animation, single finger spinning ball, crossover (two people), shooting animation, and turnaround jump shot. Technologies involved mainly include skeleton building and skin binding. Animation production process is as follows:

Step 1: Earlier conceiving

(1) Conceiving levels.

(2) Conceiving levels and actions (before triggered, when triggered, after triggered).

A relatively new operation method is designed that basketball players acting as main characters and triggers as well as scenes added to complete the level, users can play game by cards.

Step 2: Designing actions

After we have watched 20 matches and 3 2K12 matches (simulating PC basketball game), we select 6 representative, easy-to-do, and effective technical moves and standardize them in order to be more adaptable to the requirements of game material.

Step 3: The earlier preparation of animated characters

(1) Binding animation figures’ skeletons

First load the player models within the view, using the biped tool to create a basic skeleton. Use figure mode in sports panel. Then adjust the position of bones and models for alignment by means of movement, rotation, and scaling. Next enter the modify command panel, select the physique modify command, and initialize the command. Lastly adjust the detail according to the parameters, making the whole skin binding results more precise.

(2) Skeleton binding test

In sports panel, import bip generated after the skeleton binding, and make fine adjustment to bones.

Step 4: Animation

Use premiere to clip the filtered action samples and export and save in the form of sequence of frames. Then according to each frame image, establish key frames in the 3D max, and adjust the character’s joint displacement and rotation of each frame to match the action in the picture and complete the whole set of action.

3.3 Synthesis of Game Elements

In the Unity3D development environment, synthesize game elements in the 3D model, image feature recognition card and Qualcomm AR toolbox. And Qualcomm AR toolkit is mainly composed of several function modules: (1) the camera calibration and parameter collection, target labeling and tracking module. Calculate the distance and the location of the camera relative to the marking. First of all, according to the threshold set by the user, convert a collected single frame color image into a binary image (black and white); then analyze the connected domain of the binary image to find out all of the quadrilateral area as the candidate matching area. Matching each candidate area with templates in the template base, if match is produced, then the system will recognize a marker; calculate the camera position and posture relative to the known marker by the deformation of that labeled area; and finally according to the transformation matrix to realize the virtual- real registration. Based on this measure, complete the camera calibration, tag identification, 3D registration and other functions. (2) Video processing library will complete the real-time image acquisition function.

3.4 Game Production

Game production includes level, trigger action invocation and interception identification, among which interception identification determines card’s identification state according to an enumeration variable provided by the development kit, 3D coordinate relative to the game scene, and the card’s ID. In order to improve the interactivity of the game, the system designs 2 model collections: one is the model of the basketball player and the other is of basketball court. Each collection corresponds with an ID. The function of trigger action invocation is to triggers events when characters enter the special area, and the design flow is as follows (see Fig. 3):

Fig. 3.
figure 3

Game production flow

Fig. 4.
figure 4

Flow of selecting the basketball court

Fig. 5.
figure 5

Image feature identification card

4 Prototype System Implementation

In the applications of AR basketball, AR technology is embodied in two parts: (1) the selection process of basketball court; (2) the playing process of basketball players.

In the selection process of basketball court, if the image characteristics identification card is recognized when the development kit reads the video frames through cameras, calculate the position of identification card in the camera coordinate system and output the corresponding model of the basketball court on the location (as shown in Fig. 6). In the playing process of basketball players (as shown in Fig. 7), when the program recognizes identification card for basketball players, basketball game is completed by controlling the game (see Figs. 4 and 5).

Fig. 6.
figure 6

The selected basketball model

Fig. 7.
figure 7

Control flow of basketball game

Controlling trigger game, the basketball game based on AR technology is shown in Fig. 8.

Fig. 8.
figure 8

Basketball game based on AR

5 Conclusions

The game scene of virtual-real combination provides immersive feeling to users, which is the advantage of using augmented reality technology in the game. With the ever-accelerated development and improvement of mobile terminal technology, mobile phones, as an indispensable part of daily life, will show greater superiority and function. The combination of AR technology and mobile terminals will certainly bring a new research direction in the field of AR. On the basis of AR technology, the article has designed and developed a set of basketball games which adds more fun to games.