Method and system for naked-eye 3D display of 2D games
By obtaining the viewer's human eye position parameters and calculating the rotation angle and wrong cutting angle, the 2D game is 3D, which solves the problem that the existing three-dimensional 3D game screen is not vivid enough, and a more vivid three-dimensional 3D game view and a better player immersive experience are achieved.
Patent Information
- Application Number
- CN202111145477.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2041-09-28
AI Technical Summary
The existing three-dimensional 3D game screen is not vivid enough, making it difficult to leave players with a good immersive experience.
By obtaining the viewer's human eye position parameters, calculating the rotation angle and the wrong cutting angle, 3D game is 3D, and displayed on the naked eye 3D display device, the 3D game view is formed through rotation and wrong cutting.
It realizes the conversion of virtual 3D games into three-dimensional 3D games, and improves the perfection of the picture effect through rendering and interleaving, allowing players to obtain a better immersive experience and game experience.
Smart Images

Figure CN113920280B_ABST
Abstract
Description
Technical Field
[0002] The present invention relates to the technical field of 3D games, and in particular to a method and system for converting a virtual 3D game into a stereoscopic 3D game.
Background Art
[0004] With the development of electronic technology, the game industry has accounted for an increasingly large proportion in people's leisure and entertainment life. The types of games and game devices are also becoming increasingly rich. Players' requirements for game experience are constantly improving, and vivid game graphics can greatly enhance players' experience.
[0005] Most of the existing game graphics are 2D or virtual 3D. With the development of technology, stereoscopic 3D games have also emerged. However, the graphic effects of the existing stereoscopic 3D games are still not vivid enough to leave a good immersive experience for players.
Summary of the Invention
[0007] In order to solve the above technical problems, the present invention provides a method and system for converting a virtual 3D game into a stereoscopic 3D game.
[0008] A method for converting a virtual 3D game into a stereoscopic 3D game provided by the present invention includes the following steps:
[0009] Step S01: Obtain the eye position parameters of the viewer, and calculate the viewing distance and viewing angle between the display screen and the viewer at time T1.
[0010] Step S02: Predict the viewing distance and the viewing angle at time T2 according to the gyroscope data and / or the key position and force data.
[0011] Step S03: 3Dize the 2D game according to the viewing distance, the shearing angle, and the viewing angle, and display it on the naked-eye 3D display device at T2.
[0012] Preferably, the step of 3Dizing the 2D game in step S03 includes:
[0013] Step S031: Rotate the original game 3D view matrix of the game according to the viewing angle to obtain a stereoscopic view matrix.
[0014] Step S032: Shear the stereoscopic view matrix according to the shearing angle to obtain a stereoscopic view of two or more viewpoints.
[0015] Step S033: Convert the stereoscopic views of each viewpoint into views in a preset format.
[0016] Step S034: Perform layout interleaving processing on the views in the preset format to obtain a 3D game view to be rendered.
[0017] In step S035, perform rendering interleaving processing on the to-be-rendered 3D game view to generate a stereoscopic 3D game view.
[0018] Preferably, the calculation formula for the shearing angle is:
[0019] Define the coordinates of any point in the stereoscopic view as (x′, y′, z′), and after shearing the coordinates, they are (x″, y″, z″). Define θ as the shearing angle, where θ is the angle between the viewing point coordinate and the positive direction of the z′ axis, and t is an adjustment coefficient with a range of 0 < t < 1;
[0020] The shearing expression for the viewing point in the negative x-axis direction is as follows:
[0021] x″ = x′ + z′ * tan(t * θ), y″ = y′, z″ = z′;
[0022] The shearing expression for the viewing point in the positive x-axis direction is as follows:
[0023] x″ = x′ - z′ * tan(t * θ), y″ = y′, z″ = z′.
[0024] Preferably, the calculation formula for the rotation process is:
[0025] Taking the center of the screen as the origin of the coordinate system O-XYZ, the angle between the projection of the line connecting the human eye to the center of the screen on the XOZ plane and the positive semi-axis of the z-axis is α, the angle between the projection of the line connecting the human eye to the center of the screen on the YOZ plane and the positive semi-axis of the z-axis is β, and the x-axis direction points from the midpoint on the left side of the screen to the midpoint on the right side of the screen;
[0026] According to the angle α, the angle β, the distance L from the human eye to the screen, and the distance Z from the center of the scene to the screen, the angle by which the scene rotates around the y-axis can be determined:
[0027] a = arctan(L * tanα / (L + Z));
[0028] The angle by which the scene rotates around the x-axis:
[0029] b = arctan(L * tanβ / (L + Z)).
[0030] Preferably, step S01 includes:
[0031] In step S011, capture a face image through the front camera and record this moment as T1;
[0032] In step S012, calculate the facial feature points according to the AI model;
[0033] In step S013, calculate the viewing distance and viewing angle according to the size and position of the facial feature points of the same user's face during 3D effect calibration.
[0034] Preferably, step S02 includes:
[0035] Step S021, continuously sample the gyroscope and queue the sampled data;
[0036] Step S022, obtain the attitude data of the device at time T1 and the attitude data at the current time T, and predict the attitude change of the device from time T to time T2 through a 9-dimensional data AI model;
[0037] Step S23, calculate the viewing distance and viewing angle at time T through the viewing distance and viewing angle at time T1, and then superimpose the attitude change to obtain the viewing distance and viewing angle at time T2.
[0038] Preferably, in step S02, the gyroscope data and / or the key position and force data include:
[0039] Step S02a, the touch screen is a key force sensor;
[0040] Step S02b, establish an AI model for the key force and the game key position for attitude change training;
[0041] Step S02c, predict the attitude change according to the key force and the game key position during the continuous game process according to the AI model.
[0042] Preferably, before step S01, the present invention further includes the following steps:
[0043] Step Sa1, before starting the game, set a flag, and the flag includes at least a start state and a stop state;
[0044] Step Sa2, when the game is 3D-capable, set the flag to the start state; when the game is not 3D-capable, set the flag to the stop state; or, when the user clicks the 2D / 3D switch button, the flag starts / stops flipping;
[0045] Step Sa3, according to the flag, decide whether the human eye tracking module and the correction module start to work;
[0046] Step Sa4, according to the flag, decide whether to obtain the 2D game display data and 3Dize it.
[0047] The present invention also provides a system for naked-eye 3D display of 2D games, including:
[0048] A human eye tracking and positioning module, configured to obtain the human eye position parameters of the viewer, and calculate the viewing distance and viewing angle therefrom;
[0049] A 3D view generation module, configured to determine a rotation angle and a shear angle according to the viewing distance and viewing angle, 3D-ify a 2D game, and display it on a naked-eye 3D display device;
[0050] A display module, configured to perform layout interleaving processing on the view in the preset format to generate a stereoscopic 3D game view,
[0051] A grating, configured to perform layout interleaving processing on the view in the preset format received by the display module.
[0052] Preferably, it further includes a 3D game management module, which can pre-configure and adjust 3D display parameters of the 2D game during the game process.
[0053] Preferably, it further includes a gyroscope and a key force sensor.
[0054] Compared with the prior art, the method and system for converting a virtual 3D game into a stereoscopic 3D game provided by the present invention have the following beneficial effects:
[0055] A method for converting a virtual 3D game into a stereoscopic 3D game provided by the present invention first obtains the human eye position parameters of the viewer, determines the rotation angle and the shear angle according to the human eye position parameters, and then rotates the original virtual 3D view matrix of the game according to the rotation angle to obtain a stereoscopic view matrix, and according to the shear angle, performs shear on the stereoscopic view matrix to obtain stereoscopic views of each viewing point. Secondly, it converts the stereoscopic views of each viewing point into views in a preset format, and performs layout interleaving processing on the views in the preset format and then performs rendering interleaving processing, and finally generates a vivid stereoscopic 3D game view. Through the above steps, the method for converting a virtual 3D game into a stereoscopic 3D game provided by the present invention can convert the existing virtual 3D game screen into a stereoscopic 3D game screen, and through rendering interleaving processing, the display effect of the final stereoscopic 3D game screen is more perfect, thereby enabling game players to obtain a better immersive experience and greatly improving the game experience of players.
[0056] A method for converting a virtual 3D game into a stereoscopic 3D game provided by the present invention, before starting the game, first sets a flag, and judges whether the game starts in the stereoscopic 3D mode according to the state of the flag. When the game starts in the stereoscopic 3D mode, it executes step S1. When the game does not start in the stereoscopic 3D mode, it stops executing and ends this process. The setting of this flag enables the game system to judge whether the game can be converted into a stereoscopic 3D game screen in the first time, and at the same time, enables players to manually set the display mode of the game, achieving the effect of improving the game experience of players.
[0057] In the method for converting a virtual 3D game to a stereoscopic 3D game provided by the present invention, when obtaining the human eye position parameters of the viewer, such as the human eye distance and the human eye rotation angle, by cooperating the gyroscope with the camera or the gyroscope with the infrared device, the frequency and accuracy of obtaining the parameters can be greatly improved. The frequency of obtaining the parameters is greatly increased, effectively reducing the image delay caused by the movement of the relative position between the stereoscopic 3D game screen and the player, and greatly enhancing the player's gaming experience. Moreover, the improvement of the accuracy of the obtained human eye position parameters makes the accuracy of the rotation angle and the shearing angle higher, enabling the view to rotate and shear appropriately when the player looks at different angles, thus making the stereoscopic 3D view more vivid and realistic, and being able to give the game player a better immersive experience.
[0058] In the method for converting a virtual 3D game to a stereoscopic 3D game provided by the present invention, by performing layout interleaving processing and line rendering interleaving processing on the view in a preset format, the stereoscopic 3D game view finally presented by the game is made more vivid and vivid, thereby optimizing the player's gaming visual experience and further enhancing the player's immersive experience, and thus greatly enhancing the player's gaming experience.
[0059] In the method for converting a virtual 3D game to a stereoscopic 3D game provided by the present invention, the player can adjust the shearing angle according to his own feelings and needs to enhance or weaken the 3D stereoscopic parallax of the final view, adjust the strength of the 3D stereoscopic effect, and achieve the effects of reducing 3D dizziness and enhancing the 3D experience.
[0060] The present invention also provides a system for converting a virtual 3D game to a stereoscopic 3D game, which at least includes a human eye tracking and positioning module, a 3D view generation module, and a display module, and has the same beneficial effects as the above method for converting a virtual 3D game to a stereoscopic 3D game, which will not be elaborated here.
Description of the Drawings
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings, where:
[0063] Figure 1 is the schematic flow chart of the steps of the method for naked-eye 3D display of a 2D game provided by the present invention;
[0064] Figure 2 is Figure 1 the schematic flow chart of the process of 3Dizing a 2D game in step S03 in;
[0065] Figure 3 is Figure 1Flow schematic diagram of step S01;
[0066] Figure 4 is Figure 1 Schematic diagram of step S02 in
[0067] Figure 5 Schematic diagram of the step according to gyroscope data and / or key position and force data in step S02;
[0068] Figure 6 Schematic diagram of the naked-eye 3D display system for 2D games provided by the present invention.
Specific Embodiment
[0070] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0071] Please combine Figures 1 - 5 , the first embodiment of the present invention provides a method for naked-eye 3D display of 2D games, which includes the following steps:
[0072] Step S01, obtain the human eye position parameters of the viewer, and calculate the viewing distance and viewing angle between the display screen and the viewer at time T1;
[0073] Step S02, predict the viewing distance and the viewing angle at time T2 according to the gyroscope data and / or the key position and force data;
[0074] Step S03, 3Dize the 2D game according to the viewing distance, the shear angle, and the viewing angle, and display it on the naked-eye 3D display device at T2.
[0075] The step S01 includes:
[0076] Step S011, capture a face image through a front camera, and record this moment as T1;
[0077] Step S012, calculate the face feature points according to the AI model;
[0078] Step S013, calculate the viewing distance and viewing angle according to the size and position of the feature points of the same user's face during 3D effect calibration.
[0079] The step S02 includes:
[0080] Step S021, continuously sample the gyroscope and queue its sampling data;
[0081] Step S022: Obtain the attitude data of the device at time T1 and the attitude data at the current time T, and predict the attitude change of the device from time T to time T2 through a 9-dimensional data AI model.
[0082] Step S23: Calculate the viewing distance and viewing angle at time T through the viewing distance and viewing angle at time T1, and then superimpose the attitude change to obtain the viewing distance and viewing angle at time T2.
[0083] In step S02, the method based on gyroscope data and / or key position and force data includes:
[0084] Step S02a: The touch screen is a key force sensor.
[0085] Step S02b: Establish an AI model for the key force and the game key position to train the attitude change.
[0086] Step S02c: Predict the attitude change according to the key force and the game key position during the continuous game process based on the AI model.
[0087] The steps of converting a 2D game into a 3D game in step S03 include:
[0088] Step S031: Rotate the original game 3D view matrix of the game according to the viewing angle to obtain a stereoscopic view matrix.
[0089] Step S032: Shear the stereoscopic view matrix according to the shear angle to obtain a stereoscopic view of two or more viewpoints.
[0090] Step S033: Convert the stereoscopic views of the respective viewpoints into views in a preset format.
[0091] Step S034: Perform layout interleaving processing on the views in the preset format to obtain a 3D game view to be rendered.
[0092] Step S035: Perform rendering interleaving processing on the 3D game view to be rendered to generate a stereoscopic 3D game view.
[0093] The calculation formula for the shear angle is:
[0094] Define the coordinates of any point in the stereoscopic view as (x′, y′, z′), and after shearing the coordinates as (x″, y″, z″). Define θ as the shear angle, where θ is the angle between the viewpoint coordinates and the positive direction of the z′ axis, and t is an adjustment coefficient with a range of 0 < t < 1.
[0095] The shear expression for the negative X-axis viewpoint is as follows:
[0096] x″ = x′ + z′ * tan(t * θ), y″ = y′, z″ = z′;
[0097] The shear transformation expression for the positive X - axis view is as follows:
[0098] x″ = x′ - z′ * tan(t * θ), y″ = y′, z″ = z′.
[0099] The calculation formula for the rotation process is:
[0100] Taking the center of the screen as the origin of the coordinate system O - XYZ, the angle between the projection of the line connecting the human eye to the center of the screen on the XOZ plane and the positive semi - axis of the z - axis is α, the angle between the projection of the line connecting the human eye to the center of the screen on the YOZ plane and the positive semi - axis of the z - axis is β, and the X - axis direction points from the mid - point on the left side of the screen to the mid - point on the right side of the screen;
[0101] According to the angle α, angle β, the distance L from the human eye to the screen, and the distance Z from the center of the scene to the screen, the angle of rotation of the scene around the Y - axis can be determined:
[0102] a = arctan(L * tanα / (L + Z));
[0103] The angle of rotation of the scene around the X - axis:
[0104] b = arctan(L * tanβ / (L + Z)).
[0105] The present invention also provides a system for naked - eye 3D display of 2D games, including:
[0106] An eye - tracking and positioning module, which is used to obtain the eye position parameters of the viewer and calculate the viewing distance and viewing angle based on this;
[0107] A 3D view generation module, which is used to determine the rotation angle and shear angle according to the viewing distance and viewing angle, 3D - ize the 2D game and display it on the naked - eye 3D display device;
[0108] A display module, which is used to perform layout interleaving processing on the view in the preset format to generate a stereoscopic 3D game view;
[0109] A grating, which is used to perform layout interleaving processing on the view in the preset format received by the display module.
[0110] The system for naked - eye 3D display of the 2D game further includes a 3D game management module, which can pre - configure and adjust the 3D display parameters of the 2D game during the game process.
[0111] The system for naked - eye 3D display of the 2D game further includes a gyroscope and a key - force sensor.
[0112] Based on the above method of naked-eye 3D display for 2D games, the view of existing virtual 3D games can be converted into the view of a stereoscopic 3D game, and the display effect of the stereoscopic 3D view can be made more perfect, enabling game players to obtain a better immersive experience and greatly enhancing the players' gaming experience.
[0113] Further, before the above step S1, the following steps are also included:
[0114] Step Sa, determine whether the game starts in stereoscopic 3D mode. When the game starts in stereoscopic 3D mode, continue to execute step S1. When the game does not start in stereoscopic 3D mode, end this process.
[0115] Furthermore, the above step Sa specifically includes the following steps:
[0116] Step Sa1, before starting the game, set a flag, which at least includes a start state and a stop state;
[0117] Step Sa2, when the game is in virtual 3D format, set the flag to the start state, then continue to execute step S1. When the game is in non-virtual 3D format, set the flag to the stop state, then end this process.
[0118] Specifically, as an embodiment, after the above step Sa2, the following steps are also included:
[0119] Step Sa3, determine whether a stop / start signal set by the viewer is detected. If not, execute step S1; otherwise, end this process.
[0120] The setting of this flag enables the game system to determine at the first time whether the game can be converted into a stereoscopic 3D game screen. At the same time, it also enables players to manually set the display mode of the game, achieving the effect of enhancing the players' gaming experience.
[0121] Further, the above-mentioned human eye position parameters at least include the human eye distance and the human eye rotation angle, and at least one of the human eye position parameters is obtained by a gyroscope. Further still, the human eye position parameters are obtained by the cooperation of a gyroscope and a camera or the cooperation of a gyroscope and an infrared device. Existing cameras generally output data once every 33 ms. When the relative position of the player and the game screen moves, the update of the stereoscopic 3D game screen will have a relatively high delay. The gyroscope can output 1000 times of data per second, that is, it outputs data once every 1 ms. By the cooperation of the gyroscope and the camera or the cooperation of the gyroscope and the infrared device, the frequency and accuracy of obtaining parameters can be greatly improved. The frequency of obtaining parameters is greatly increased, effectively reducing the image delay caused by the relative movement of the stereoscopic 3D game screen and the player, and greatly improving the game experience of the player; the accuracy of the obtained human eye position parameters is improved, making the accuracy of the rotation angle and the shearing angle higher, so that when the player looks at different angles, the view can be properly rotated and sheared, making the stereoscopic 3D view more vivid and realistic, and being able to give the game player a better immersive experience.
[0122] Further still, the above-mentioned human eye distance is the distance between the human eye position and the center of the screen; the above-mentioned human eye rotation angle is the angle change between the human eye position and the center of the screen.
[0123] Specifically, as an embodiment, in the method for converting a virtual 3D game to a stereoscopic 3D game provided in the first embodiment of the present invention, the specific calculation method for obtaining the stereoscopic views of each viewpoint is as follows:
[0124] Step Sb, in the space with the center of the screen as the origin of the O-XYZ three-dimensional coordinate system, according to the distance from the human eye position to the screen and the distance from the scene center to the screen, calculate the angle α of the scene rotating around the Y axis and the angle β of the scene rotating around the X axis;
[0125] Step Sc, according to the angle change between the human eye position and the center of the screen, calculate the angle c of the viewer rotating around the Y axis with the center of the screen and the angle d of the viewer rotating around the X axis with the center of the screen;
[0126] Step Sd, according to the angle a of the scene rotating around the Y axis, the angle b of the scene rotating around the X axis, the angle c of the viewer rotating around the Y axis with the center of the screen, and the angle d of the viewer rotating around the X axis with the center of the screen, obtain the first rotation matrix and the second rotation matrix;
[0127] Step Se, multiply the virtual view matrix on the right by the first rotation matrix and the second rotation matrix to obtain the stereoscopic view matrix.
[0128] Specifically, the angle between the projection of the line connecting the human eye to the center of the screen on the XOZ plane and the positive semi-axis of the Z-axis is α, and the angle between the projection of the line connecting the human eye to the center of the screen on the YOZ plane and the positive semi-axis of the Z-axis is β. Among them, the X-axis is in the same direction as the left-right direction of the screen, and the positive direction of the X-axis is from the center of the left side of the screen to the center of the right side of the screen. The Y-axis is in the same direction as the up-down direction of the screen, and the positive direction of the Y-axis is from the midpoint above the screen to the midpoint below the screen. According to the angles α, β, the distance H from the human eye to the screen, and the distance J from the center of the scene to the screen, the angle a by which the scene rotates around the Y-axis can be determined as follows:
[0129]
[0130] The angle b by which the scene rotates around the X-axis can be determined as follows:
[0131]
[0132] When the human eye position is obtained, the angle between the human eye position and the center of the screen is V1 (aax1, aay1, aaz1), and the angle between the human eye position and the center of the screen before outputting the stereoscopic view matrix is V2 (aax2, aay2, aaz2). The angle data V of the change between the human eye position and the center of the screen is obtained through V1 and V2:
[0133] V = V2 - V1 = (aax2 - aax1, aay2 - aay1, aaz2 - aaz1)
[0134] The angle c by which the viewer and the center of the screen rotate around the Y-axis can be obtained through the changed angle data V as follows:
[0135] c = a + aax2 - aax1
[0136] The angle d by which the viewer and the center of the screen rotate around the X-axis can be obtained through the changed angle data V as follows:
[0137] d = b + aay2 - aay1
[0138] According to the angle c by which the viewer and the center of the screen rotate around the Y-axis and the angle d by which the viewer and the center of the screen rotate around the X-axis, the first rotation matrix M1 and the second rotation matrix M2 are obtained. The specific formulas of M1 and M2 are as follows:
[0139]
[0140]
[0141] The virtual view matrix before rotation is represented by A, and the stereoscopic view matrix is represented by A'. Then:
[0142] A' = M1·M2·A
[0143] As a preferred embodiment, after step S3, the following steps are further included:
[0144] Step Sf, analyze the face image of the viewer, and adjust the distance from the scene center to the screen and / or the size of the shearing angle according to the analysis result.
[0145] Generate a shearing matrix according to the adjusted distance from the scene center to the screen and / or the adjusted shearing angle, and generate a stereoscopic view of each viewpoint through the shearing matrix and the stereoscopic view matrix.
[0146] Based on the above steps, by analyzing the face image of the viewer and adjusting the distance from the scene center to the screen and / or the shearing angle according to the analysis result, the present invention updates the shearing matrix in real time according to different viewers, and while providing the best stereoscopic view, greatly improves the viewing experience of the viewer.
[0147] Further, the specific adjustment method for the distance from the scene center to the screen and / or the size of the shearing angle in step Sf is: obtain the distance between the viewer's left eye and right eye, and according to the distance between the left eye and right eye, add a pre-set distance L to the distance from the screen to the scene center and / or multiply the shearing angle by a corresponding adjustment coefficient t to obtain the adjusted distance between the screen and the scene center and / or the adjusted shearing angle, where 0 < t < 1, and the distance L and the adjustment coefficient t can be set by the viewer himself.
[0148] Specifically, the rotated new coordinate system is represented by O′-X′Y′Z′, the origin O′ coincides with the origin position of the original O-XYZ three-dimensional coordinate system, the positive direction of the Z′ axis points along the observer's coordinate in the original coordinate system to the viewpoint center coordinate, and the adjusted shearing angle transformation means that y′ and z′ of the viewpoint remain unchanged, and the x′ value is linearly transformed with the z′ axis as the dependent axis. Let the shearing angle θ be the angle between the viewpoint coordinate and the positive direction of the z′ axis, and the coordinate of any point (x′, y′, z′) in the scene, after shearing, is (x″, y″, z″). According to the stereoscopic view matrix and the shearing angle, the shearing expression of the viewpoint in the negative direction of the X axis is as follows:
[0149] x″ = x′ + z′×tan(t×θ); y″ = y′; z″ = z′.
[0150] The shearing expression of the viewpoint in the positive direction of the X axis is as follows:
[0151] x″ = x′ - z′×tan(t×θ); y″ = y′; z″ = z′.
[0152] Through the above formula, the shearing angle can be adjusted according to the distance between the left eye and the right eye of the viewer, so as to obtain the optimal projection angles of the stereoscopic views for the left and right eyes. At the same time, the value of the adjustment coefficient t is limited between 0 and 1 to avoid excessive deformation of the stereoscopic views caused by an overly large shearing angle.
[0153] As a preferred embodiment, after the above step S4, the following steps are further included:
[0154] Step Sg: Automatically adjust the parallax of the stereoscopic view according to the value of the virtual view on the Z axis and a preset threshold.
[0155] Specifically, during the process of converting the virtual view matrix to the stereoscopic view, there may be situations where z′ is too large or too small. As a result, the parallax of some areas of the sheared stereoscopic view is too large or too small, which is likely to cause dizziness in the viewer and thus affect the viewing experience. In the embodiments of the present invention, this phenomenon is avoided by automatically adjusting the parallax of the stereoscopic view smoothly with z′. Specifically, zg and zt are preset thresholds on the Z axis, and the viewer can set the magnitudes of zg and zt by themselves. After adjustment, the shearing expression of the viewing point in the negative X axis direction is as follows:
[0156]
[0157] y″ = y′
[0158] z″ = z′
[0159] Therefore, the shearing matrix is:
[0160]
[0161] The shearing matrix for the viewing point in the positive X axis direction after adjustment is:
[0162]
[0163] The stereoscopic views A″ of each viewing point are generated by multiplying the shearing matrix M3 on the right by the corresponding stereoscopic view matrix, realizing the automatic adjustment of the parallax of the stereoscopic view, where:
[0164] A″ = M3·A′ = M3·M1·M2·A
[0165] Specifically, as an embodiment, in the method for converting a virtual 3D game to a stereoscopic 3D game provided in the first embodiment of the present invention, the human eye position parameters are obtained by cooperating a gyroscope with a camera.
[0166] Further, in the method for converting a virtual 3D game to a stereoscopic 3D game provided in the first embodiment of the present invention, the stereoscopic views of each viewpoint are converted into views in a preset format, and the preset format may be a left-right format, an up-down format, or a nine-grid format. Specifically, as an embodiment, in the method for converting a virtual 3D game to a stereoscopic 3D game provided in the first embodiment of the present invention, the stereoscopic views of each viewpoint are converted into views in the left-right format.
[0167] Further, the views in the preset format are subjected to layout interleaving processing and row rendering interleaving processing, so that the stereoscopic 3D game view finally presented by the game is more vivid and vivid, thereby optimizing the player's game visual experience and further enhancing the player's immersive experience, thus greatly enhancing the player's game experience.
[0168] Optionally, the shearing angle is adjusted according to the setting parameters of the viewer. Specifically, the player can adjust or not adjust the setting parameters according to his own needs. When the player adjusts the setting parameters according to his own feelings and needs, the shearing angle changes accordingly with the change of the setting parameters, so as to correspondingly enhance or weaken the 3D stereoscopic parallax of the stereoscopic 3D game view, adjust the strength of the 3D stereoscopic effect, and achieve the effects of reducing 3D dizziness and enhancing 3D experience; when the player does not adjust the setting parameters according to his own feelings and needs, the value of the shearing angle is the value calculated according to the human eye position parameters in step S2.
[0169] Optionally, the setting parameters can be adjusted through the UI interface or through buttons, and the specific adjustment method is not limited. Specifically, as an embodiment, in the method for converting a virtual 3D game to a stereoscopic 3D game provided in the first embodiment of the present invention, the setting parameters are adjusted through the UI interface.
[0170] Please refer to Figure 6 , the second embodiment of the present invention provides a system 1 for converting a virtual 3D game to a stereoscopic 3D game, which at least includes a human eye tracking and positioning module 12, a 3D view generation module 13, and a display module 14.
[0171] Further, the human eye tracking and positioning module 12 at least includes a gyroscope (not shown in the figure) for obtaining the human eye position parameters of the viewer, where the human eye position parameters at least include the human eye distance and the human eye rotation angle.
[0172] Further, its 3D view generation module 13 is used to first determine the rotation angle and shear angle according to the human eye position parameters, secondly rotate the original virtual 3D view matrix of the game according to the rotation angle to obtain a stereoscopic view matrix, and according to the shear angle, shear the stereoscopic view matrix to obtain the stereoscopic views of each viewpoint. Then, convert the stereoscopic views of each viewpoint into views in a preset format, and finally transmit the views in the preset format to the display module 14. The display module 14 at least includes a grating. The display module 14 performs layout interleaving processing on the received views in the preset format according to the physical parameters of the grating to obtain a 3D game view to be rendered. Then, the display module 14 performs rendering interleaving processing on the 3D game view to be rendered to generate a final stereoscopic 3D game view. By performing layout interleaving processing and line rendering interleaving processing on the views in the preset format, the final stereoscopic 3D game view presented by the game is made more vivid and vivid, thereby optimizing the player's game visual experience and further enhancing the player's immersive experience, thus greatly enhancing the player's game experience.
[0173] Optionally, in the system 1 for converting a virtual 3D game into a stereoscopic 3D game provided in the second embodiment of the present invention, there is further included a stereoscopic 3D game startup module for determining whether the game starts in the stereoscopic 3D mode. When the game starts in the stereoscopic 3D mode, the system continues to operate. When the game does not start in the stereoscopic 3D mode, the system stops operating.
[0174] Specifically, the working principle of the stereoscopic 3D game startup module is as follows: Before starting the game, the stereoscopic 3D game startup module at least includes a flag (not shown in the figure). The flag has at least two states: a startup state and a stop state. When the game is in the virtual 3D format, the flag is in the startup state, and then step Sa3 or step S1 is continued to be executed. When the game is not in the virtual 3D format, the flag is in the stop state, and then the execution is stopped. When a startup signal set by the viewer is detected or no signal set by the viewer is detected, the flag is in the startup state, and then step S1 is continued to be executed. When a stop startup signal set by the viewer is detected, the flag is adjusted to the stop state, and then the execution is stopped.
[0175] Optionally, the system for converting a virtual 3D game to a stereoscopic 3D game according to the second embodiment of the present invention further includes a stereoscopic parallax control module, and the viewer adjusts the shearing angle through the stereoscopic parallax control module. Specifically, the working principle of the stereoscopic parallax control module is as follows: A set parameter is set inside the stereoscopic parallax control module, and the player can adjust the set parameter according to his own needs or not adjust it. When the player adjusts the set parameter according to his own feelings and needs, the shearing angle changes accordingly according to the change of the set parameter, so as to correspondingly enhance or weaken the 3D stereoscopic parallax of the stereoscopic 3D game view, adjust the strength of the 3D stereoscopic effect, and achieve the effects of reducing the 3D dizziness and enhancing the 3D experience; when the player does not adjust the set parameter according to his own feelings and needs, the value of the shearing angle is the value calculated according to the human eye position parameter in step S2.
[0176] Optionally, the stereoscopic parallax control module includes a UI interface or a button for receiving the player's stereoscopic parallax adjustment instruction. It can be understood that the components for receiving the player's adjustment instruction in the stereoscopic parallax control module are not limited to the UI interface or the button, as long as they can receive the player's adjustment instruction.
[0177] Compared with the prior art, the method and system for converting a virtual 3D game to a stereoscopic 3D game provided by the present invention have the following beneficial effects:
[0178] First, for the method for converting a virtual 3D game to a stereoscopic 3D game provided by the present invention, the method first obtains the human eye position parameter of the viewer, calculates the rotation angle and the shearing angle according to the human eye position parameter, and then rotates the original virtual 3D view matrix of the game according to the rotation angle to obtain the stereoscopic view matrix, and according to the shearing angle, shear the stereoscopic view matrix to obtain the stereoscopic views of each viewpoint. Secondly, convert the stereoscopic views of each viewpoint into views in a preset format, and perform layout interleaving processing and then rendering interleaving processing on the views in the preset format, and finally generate a vivid stereoscopic 3D game view. Through the above steps, the method for converting a virtual 3D game to a stereoscopic 3D game provided by the present invention can convert the existing virtual 3D game screen into a stereoscopic 3D game screen, and through the rendering interleaving processing, the display effect of the final stereoscopic 3D game screen is more perfect, so that the game player can obtain a better immersive experience and greatly improve the game experience of the player.
[0179] II. A method for converting a virtual 3D game into a stereoscopic 3D game provided by the present invention. Before starting the game, a flag is set first. First, when the game is in virtual 3D format, the flag is in the start state, then continue to execute; when the game is in non-virtual 3D format, the flag is in the stop state, then stop executing. Second, when a start signal set by the viewer is detected or no signal set by the viewer is detected, the flag is in the start state and continue to execute; when a stop start signal set by the viewer is detected, the flag is adjusted to the stop state, then stop executing. The setting of this flag enables the game system to judge whether the game can be converted into a stereoscopic 3D game screen in the first place, and at the same time, enables the player to manually set the display mode of the game, achieving the effect of enhancing the player's game experience.
[0180] III. In the method for converting a virtual 3D game into a stereoscopic 3D game provided by the present invention, when obtaining the human eye position parameters of the viewer such as the human eye distance and the human eye rotation angle, by cooperating the gyroscope with the camera or the gyroscope with the infrared device, the frequency and accuracy of obtaining the parameters can be greatly improved. The frequency of obtaining the parameters is greatly increased, effectively reducing the image delay caused by the relative movement between the stereoscopic 3D game screen and the player, and greatly enhancing the player's game experience. And the improvement of the accuracy of the obtained human eye position parameters makes the accuracy of the rotation angle and the shear angle higher, enabling the view to rotate and shear appropriately when the player looks at different angles, so that the stereoscopic 3D view is more vivid and realistic, and can give the game player a better immersive experience.
[0181] IV. In the method for converting a virtual 3D game into a stereoscopic 3D game provided by the present invention, by performing layout interleaving processing and row rendering interleaving processing on the views in a preset format, the stereoscopic 3D game view finally presented by the game is more vivid and vivid, thereby optimizing the player's game visual experience and further enhancing the player's immersive experience, thus greatly enhancing the player's game experience.
[0182] V. In the method for converting a virtual 3D game into a stereoscopic 3D game provided by the present invention, the player can adjust the shear angle according to his own feelings and needs to enhance or weaken the 3D stereoscopic parallax of the final view, adjust the strength of the 3D stereoscopic effect, achieving the effects of reducing 3D dizziness and enhancing 3D experience.
[0183] VI. The present invention also provides a system for converting a virtual 3D game into a stereoscopic 3D game, which at least includes a human eye tracking and positioning module, a 3D view generation module and a display module, and has the same beneficial effects as the above-mentioned method for converting a virtual 3D game into a stereoscopic 3D game, which will not be elaborated here.
[0184] The above is only one embodiment of the present invention, and thus does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall similarly be included within the patent protection scope of the present invention.
Claims
1. A method for naked-eye 3D display of 2D games, characterized in that, It includes the following steps: Step S01: Obtain the eye position parameters of the viewer, calculate the viewing distance and viewing angle between the display screen and the viewer at time T1. The eye position parameters include at least the eye distance and the eye rotation angle, and at least one of the eye position parameters is obtained through a gyroscope. The eye distance is the distance between the eye position and the center of the screen, and the eye rotation angle is the angle change between the eye position and the center of the screen. Step S02: Predict the viewing distance and the viewing angle at time T2 according to the gyroscope data and / or the key position and force data, which includes: Step S021: Continuously sample the gyroscope and queue the sampled data. Step S022: Obtain the attitude data of the device at time T1 and the attitude data at the current time T, and predict the attitude change of the device from time T to time T2 through a 9-dimensional data AI model. Step S23: Calculate the viewing distance and viewing angle at time T through the viewing distance and viewing angle at T1, and then superimpose the attitude change to obtain the viewing distance and viewing angle at time T2. Step S03: 3Dize the 2D game according to the viewing distance, the shearing angle, and the viewing angle, and display it on the naked-eye 3D display device at T2.
2. The method for naked-eye 3D display of a 2D game according to claim 1, wherein, The steps of 3Dizing the 2D game in step S03 include: Step S031: Rotate the original game 3D view matrix of the game according to the viewing angle to obtain a stereoscopic view matrix. Step S032: Shear the stereoscopic view matrix according to the shearing angle to obtain a stereoscopic view of two or more viewpoints. Step S033: Convert the stereoscopic views of each viewpoint into views in a preset format. Step S034: Perform layout interleaving processing on the views in the preset format to obtain a 3D game view to be rendered. Step S035: Perform rendering interleaving processing on the 3D game view to be rendered to generate a stereoscopic 3D game view.
3. The method for naked-eye 3D display of a 2D game according to claim 2, wherein The calculation formula for the shearing angle is: Define the coordinates of any point in the stereoscopic view as (x′, y′, z′), and the coordinates after shearing as (x″, y″, z″). Define θ as the shearing angle, which is the angle between the viewpoint coordinates and the positive direction of the z′ axis, and t as the adjustment coefficient, with the range 0 < t < 1. The shearing expression for the viewpoint in the negative X-axis direction is as follows: x″ = x′ + z′ * tan(t * θ), y″ = y′, z″ = z′; The shearing expression for the viewpoint in the positive X-axis direction is as follows: x″ = x′ - z′ * tan(t * θ), y″ = y′, z″ = z′.
4. The method for naked-eye 3D display of a 2D game according to claim 2, characterized in that, The calculation formula for the rotation process is: Taking the center of the screen as the origin of the coordinate system O-XYZ, the angle between the projection of the line connecting the human eye to the center of the screen on the XOZ plane and the positive half-axis of the z-axis is α, the angle between the projection of the line connecting the human eye to the center of the screen on the YOZ plane and the positive half-axis of the z-axis is β, and the X-axis direction points from the midpoint on the left side of the screen to the midpoint on the right side of the screen. According to the angle α, the angle β, the distance L from the human eye to the screen, and the distance Z from the scene center to the screen, the angle of rotation of the scene around the Y-axis can be determined: a = arctan(L * tanα / (L + Z)); Angle of scene rotation around the X-axis: b = arctan(L * tanβ / (L + Z)).
5. The method for naked-eye 3D display of a 2D game according to claim 1, wherein The step S01 includes: Step S011, capturing a face image through a front camera and recording this moment as T1; Step S012, calculating facial feature points according to an AI model; Step S013, when calibrating according to the 3D effect, calculating the viewing distance and viewing angle based on the size and position of the facial feature points of the same user's face.
6. The method for naked-eye 3D display of a 2D game according to claim 1, characterized in that, In the step S02, according to the gyroscope data and / or the key position and force data includes: Step S02a, the touch screen serves as a key force sensor; Step S02b, establishing an AI model for the key force and the game key position to train the posture change; Step S02c, predicting the posture change according to the key force and the game key position during the continuous game process based on the AI model.
7. A system for naked-eye 3D display of 2D games, characterized in that, Includes: An eye tracking and positioning module, used to obtain the eye position parameters of the viewer, thereby calculating the viewing distance and viewing angle between the display screen and the viewer at time T1. The eye position parameters at least include the eye distance and the eye rotation angle, and at least one of the eye position parameters is obtained through the gyroscope. The eye distance is the distance between the eye position and the center of the screen, and the eye rotation angle is the angle change between the eye position and the center of the screen; it is also used to continuously sample the gyroscope and queue its sampling data; it is also used to obtain the posture data of the device at time T1 and the posture data at the current time T, and predict the posture change of the device from time T to time T2 through a 9-dimensional data AI model; it is also used to calculate the viewing distance and viewing angle at time T through the viewing distance and viewing angle at T1, and then superimpose the posture change to obtain the viewing distance and viewing angle at time T2; A 3D view generation module, used to determine the rotation angle and the shear angle according to the viewing distance and viewing angle, and 3Dize the 2D game and display it on the naked-eye 3D display device at T2; A display module, used to perform layout interleaving processing on the view in the preset format to generate a stereoscopic 3D game view; A grating, used to perform layout interleaving processing on the view in the preset format received by the display module.
8. The naked-eye 3D display system for 2D games according to claim 7, characterized in that, It also includes a 3D game management module, which can pre-configure and adjust the 3D display parameters of the 2D game during the game process.
Citation Information
Patent Citations
Naked eye 3D display method based on eye tracking
CN108600733A
Naked eye 3D display method and device and terminal
CN109842793A
Method and device for converting self-adaptive virtual view into stereoscopic view, which are applied to 3D game rendering engine
CN113379897A