Cocos practical case: Experts analyze how to play 3D in "Fishing Master 3"

Cocos practical case: Experts analyze how to play 3D in "Fishing Master 3"

At the Cocos 2015 Spring Developer Conference that ended not long ago, the 3D games developed with the Cocos engine demonstrated on site received a good response from developers. Currently, a small number of people have begun to try to use Cocos for advanced operations to achieve 3D functions. In fact, using Cocos to develop 3D is not out of reach. Next, we will analyze it from the perspective of principles.

[[132176]]

3D Imaging Principles

"Virtual reality" is the use of equipment to simulate/reproduce various human senses, including but not limited to sight, hearing, smell, touch, temperature, etc., among which vision (polarized 3D imaging) is the most important and feasible.

Before the rapid development of brain wave technology, there were only two ways to provide an "immersive" visual experience: make the screen bigger, or shorten the distance between the eyes and the screen. Obviously, virtual display glasses use the latter. While making the screen bigger, it isolates the outside light, which will create an illusion of being immersed in another space. With the help of body position sensors such as three-axis gyroscopes and gravity sensors, the picture can respond accordingly to the movement of the wearer's head, producing visual feedback that is close to reality.

[[132177]]

How to achieve 3D?

Polarized 3D imaging is invented based on the principle of human eye imaging. The scene seen by the human eye appears three-dimensional because the scenes observed by both eyes are slightly different, because the pupil distance (the distance between the two eyeballs) causes the angles of the observed objects to be different.

Polarization imaging is to send two images with different polarization states to both eyes, and each eye is only allowed to see one of them. When we use Cocos to make 3D games, we are actually making these two images, or simulating 3D signals.

What can current hardware technology do for us and what do we need to do?

Before the emergence of true 3D monitors, we could only use two projectors to achieve the 3D effect when making 3D stereoscopic games. As game developers, we only needed to simulate two images of half the width on the left and right.

How to simulate 3D images with the Cocos engine

To simulate a real 3D stereo image, we must first know the principle of human eye imaging, because we have two eyes, separated by a certain distance (about 150px), so there is a sense of distance. We all know that the camera in Cocos simulates human eyes. Generally, we create one camera to observe the scene in Cocos, so of course there is no sense of three-dimensionality. To simulate human eyes, we need to create two cameras and separate them by a small distance, adjust the angle to the same, and pay attention not to look in the middle, but look straight ahead. Human eyes also look straight ahead, similar to the following:

The 3D output effects of Fishing Master 3 are as follows:

From the above analysis, we can see that using the Cocos engine to achieve 3D through physical imaging is not so mysterious. As the hardware level of users continues to improve, we can see that 3D is definitely the future trend of mobile games. However, products that only pursue 3D without considering the overall effect of the game are still uncompetitive in the market. A game needs to continuously innovate in content in order to go long-term after it is launched on the market.

<<:  A simple implementation method of "callback feature" under Cocos2d-x3.5

>>:  Testin Crash Analysis Breadcrumb Function Sweepers Crash Problems

Recommend

Web Development Trends in 2015

[[126116]] The Web was originally conceived as a ...

Notice! Douyin, Baidu, and Toutiao's future marketing guidelines revealed~

Looking at the market, from the initial portal er...

A complete guide to advertising on TikTok!

You may be running campaigns on more established ...

Why do users keep churning? Teach you 3 stages of user retention methods

Product retention is similar to product onboardin...

5 basic steps for online operation and promotion!

Whether it is online operation and promotion or o...

Stay! New species are lurking around us

Seaside Lycoris Picture Bai Yu Baohua Old Crow Pe...

A complete guide to operating and promoting Tik Tok!

Do you know how to use Tik Tok, which has huge tr...

Inspirational short film 8 minutes to understand the true meaning of life

Inspirational short film 8 minutes to understand t...

Why do we cut mooncakes into pieces? It's not because they are too big.

In addition to symbolizing reunion, eating moonca...