A data processing method and device
By detecting the rotation control of the virtual camera view angle in the 3D view, determining and applying rotation control parameters to control the rotation of the target virtual 3D model, the display abnormality caused by view angle changes is solved, and the user experience and driving safety is improved.
Patent Information
- Application Number
- CN202210124516.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-10
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-02-10
AI Technical Summary
When the viewing angle of the 3D view changes, a virtual 3D model such as the "P" logo may display abnormalities, affecting the user's visual experience and endangering safe driving.
By detecting the rotation control of the virtual camera viewing angle, the rotation control parameters of the target virtual 3D model are determined and the rotation of the model is controlled according to these parameters to maintain its stable display when the viewing angle changes.
The virtual 3D model is displayed stably with the change of viewing angle, which improves the user's visual experience and ensures the safe driving of the vehicle.
Smart Images

Figure CN114463527B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a method and device for data processing. Background Art
[0002] Currently, smart vehicles can present 3D views to users for processes such as parking. The 3D view can present different perspectives as the vehicle moves or the user operates. For example, the perspective of the 3D view will automatically change when the vehicle turns, and the user can rotate the perspective of the 3D view through 3D gestures.
[0003] When the viewing angle of the 3D view changes, the virtual 3D model itself presented in the 3D view remains stationary, and thus appears to the user in different styles due to the change in the viewing angle of the 3D view.
[0004] However, for some virtual 3D models, such as the "P" sign used to indicate parking spaces in the 3D parking interface, due to their relatively thin size, they may display abnormally after the 3D view is rotated to a certain viewing angle. For example, they may disappear in the 3D view or appear translucent, affecting the user's visual experience and even the safe driving of the vehicle. Summary of the Invention
[0005] In view of the above problems, a data processing method and apparatus are proposed to overcome the above problems or at least partially solve the above problems, including:
[0006] A data processing method, comprising:
[0007] Presenting a 3D view based on a virtual camera perspective to a user, wherein the 3D view includes a target virtual 3D model, and the target virtual 3D model is presented in a first style;
[0008] When a rotation control of the virtual camera viewing angle is detected, determining a target rotation control parameter for the target virtual 3D model;
[0009] The target virtual 3D model is controlled to rotate according to the target rotation control parameter, so that the target virtual 3D model is kept presented in the first style.
[0010] Optionally, determining a target rotation control parameter for the target virtual 3D model includes:
[0011] determining a first rotation control parameter of the virtual camera with respect to a forward direction;
[0012] determining a second rotation control parameter of the virtual camera with respect to an upward direction;
[0013] A target rotation control parameter for the target virtual 3D model is obtained according to the first rotation control parameter and the second rotation control parameter.
[0014] Optionally, determining a first rotation control parameter of the virtual camera in a forward direction includes:
[0015] Get the current direction vector of the virtual camera;
[0016] A first rotation control parameter of the virtual camera with respect to the forward direction is determined according to the current heading vector and a preset standard forward vector.
[0017] Optionally, determining a second rotation control parameter of the virtual camera in an upward direction includes:
[0018] Get the current up direction vector of the virtual camera;
[0019] Determine the target upward direction vector;
[0020] A second rotation control parameter of the virtual camera with respect to the upward direction is determined according to the current upward direction vector and the target upward direction vector.
[0021] Optionally, determining a second rotation control parameter of the virtual camera in the upward direction according to the current upward direction vector and the target upward direction vector includes:
[0022] Determine a first plane according to the current heading vector and the current upward direction vector, and determine a first normal vector perpendicular to the first plane;
[0023] Determine a second plane according to the first normal vector and the current orientation vector, and determine a second normal vector perpendicular to the second plane;
[0024] A second rotation control parameter of the virtual camera with respect to the upward direction is determined according to the current upward direction vector, the target upward direction vector, and the second normal vector.
[0025] Optionally, determining a target upward direction vector includes:
[0026] A target upward direction vector is obtained according to the first rotation control parameter and a preset standard upward direction vector.
[0027] Optionally, the target rotation control parameter is a parameter in the form of a quaternion, and the target virtual 3D model is controlled to rotate according to the target rotation control parameter, including:
[0028] Convert the target rotation control parameters into a target matrix;
[0029] According to the target matrix, the target virtual 3D model is controlled to rotate.
[0030] A data processing device, comprising:
[0031] a 3D view rendering module, configured to present a 3D view based on a virtual camera perspective to a user, wherein the 3D view includes a target virtual 3D model, and the target virtual 3D model is presented in a first style;
[0032] a target rotation control parameter determination module, configured to determine target rotation control parameters for a target virtual 3D model when a rotation control of the virtual camera viewing angle is detected;
[0033] The rotation control controls the target virtual 3D model to rotate according to the target rotation control parameter, so that the target virtual 3D model is kept presented in the first style.
[0034] A vehicle includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the data processing method described above is implemented.
[0035] A computer-readable storage medium stores a computer program, which implements the data processing method described above when executed by a processor.
[0036] The embodiments of the present invention have the following advantages:
[0037] In an embodiment of the present invention, a 3D view based on a virtual camera perspective is presented to a user, wherein the 3D view has a target virtual 3D model, and the target virtual 3D model is presented in a first style. When rotation control of the virtual camera perspective is detected, target rotation control parameters for the target virtual 3D model are determined, and then, according to the target rotation control parameters, the target virtual 3D model is controlled to rotate so that the target virtual 3D model remains presented in the first style. This realizes rotation control of the virtual 3D model in the 3D view, enables the virtual 3D model to move with the virtual camera perspective, avoids the virtual 3D model presenting different styles to the user due to changes in perspective, improves the user's visual experience, and ensures safe driving of the vehicle. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the description of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0039] Figure 1 This is a flowchart of the steps of a data processing method provided by one embodiment of the present invention.
[0040] Figure 2a This is a 3D view provided by an embodiment of the present invention.
[0041] Figure 2b This is another 3D view provided by an embodiment of the present invention.
[0042] Figure 3 This is a flowchart of the steps of a data processing method provided by one embodiment of the present invention.
[0043] Figure 4 This is a structural block diagram of a data processing device provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0044] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments described are only a portion of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are also within the scope of protection of the present invention.
[0045] Reference Figure 1 , which shows a flowchart of a data processing method provided by an embodiment of the present invention, which may specifically include the following steps:
[0046] Step 101: presenting a 3D view based on a virtual camera perspective to a user, wherein the 3D view includes a target virtual 3D model, and the target virtual 3D model is presented in a first style.
[0047] During the driving process of the vehicle, which may include the process of the vehicle driving forward or the process of the vehicle parking, the vehicle can generate a 3D view based on the collected surrounding environment information and present the 3D view to the user through the on-board screen.
[0048] Specifically, the 3D view can be presented from a virtual camera perspective, and the 3D view can have multiple virtual 3D models. The multiple virtual 3D models can include a virtual 3D model of the vehicle itself, virtual 3D models of objects scanned in the surrounding environment (such as virtual 3D models of pedestrians, other vehicles, and obstacles), and virtual 3D models for prompting users (such as a "P" sign for indicating parking spaces).
[0049] The target virtual 3D model may be a virtual 3D model in the 3D view that meets preset conditions. For example, the target virtual 3D model may be a "P" sign used to indicate a parking space in a 3D parking interface. The preset condition may be that the volume is smaller than a preset volume.
[0050] Without rotating the virtual camera perspective, the target virtual 3D model can be presented to the user in a first style, such as a front view of the target virtual 3D model. In this first style, the user can clearly see the target virtual 3D model.
[0051] Step 102 : When a rotation control of the virtual camera viewing angle is detected, target rotation control parameters for the target virtual 3D model are determined.
[0052] In practice, the 3D view's perspective can change based on the vehicle's driving conditions. When a specific driving condition, such as a turn, is detected, the 3D view's perspective can automatically change, triggering rotation control of the virtual camera's perspective. Of course, the user can also manually trigger rotation control of the virtual camera's perspective. For example, the user can rotate the 3D view's perspective using 3D gestures, which can trigger rotation control of the virtual camera's perspective.
[0053] The virtual 3D model presented in the 3D view remains stationary in the 3D view. When the rotation control of the virtual camera's perspective is detected, the perspective of the 3D view needs to be switched. Accordingly, the virtual 3D model in the 3D view needs to be presented at different angles, that is, in different styles. This can be understood as presenting different styles for different objects when the camera is moved to shoot.
[0054] For target virtual 3D models that meet the preset conditions, such as the "P" sign used to indicate parking spaces in the 3D parking interface, due to their relatively thin size, they may display abnormalities after the 3D view is rotated to a certain viewing angle, such as disappearing in the 3D view or appearing translucent, and other inappropriate display conditions, affecting the user's visual experience and even affecting the safe driving of the vehicle.
[0055] Based on this, in order to avoid the impact of perspective rotation on the presentation of the target virtual 3D model, when the rotation control of the virtual camera perspective is detected, the target rotation control parameters for the target virtual 3D model can be determined. The target rotation control parameters can be used to control the rotation of the target virtual 3D model, thereby enabling the target virtual 3D model to move with the perspective rotation of the virtual camera, avoiding the situation where the virtual camera perspective rotates while the target virtual 3D model remains stationary.
[0056] In one embodiment of the present invention, step 102 may include:
[0057] Sub-step 11: determining a first rotation control parameter of the virtual camera in the forward direction.
[0058] In a specific implementation, the forward direction can be a direction parallel to the downward direction of the vehicle screen. The first rotation control parameter of the virtual camera for the forward direction can be determined based on the current orientation of the virtual camera, which can be the direction of the virtual camera toward the vehicle screen.
[0059] In one embodiment of the present invention, sub-step 11 may include:
[0060] Sub-step 111: Obtain the current orientation vector of the virtual camera.
[0061] In a specific implementation, the current orientation vector of the virtual camera can be obtained. The current orientation information can be the vector of the direction of the virtual camera toward the vehicle screen. The following method can be used:
[0062] Vector3 dir=camera.direction.cpy()
[0063] Among them, Vector3 is a class for 3D vectors or points, dir and camera.direction represent the current direction vector of the virtual camera, and cpy() is a function for copy operations.
[0064] In one example, in order to change the original value of the variable in subsequent operations, dir can be reassigned as follows:
[0065] Vector3 start=new Vector3(dir.x,dir.y,dir.z)
[0066] Among them, start represents the current direction vector after reassignment, new is the assignment function, dir.x, dir.y, and dir.z are the horizontal, vertical, and vertical coordinates of the current direction vector respectively.
[0067] Sub-step 112: determining a first rotation control parameter of the virtual camera in the forward direction according to the current heading vector and a preset standard forward vector.
[0068] The standard forward vector may be a vector having a length of 1 in the forward direction, for example, its coordinates may be (0, 0, -1), which are coordinates with reference to the vehicle screen.
[0069] After obtaining the current heading vector, we can calculate the angle between the current heading vector and the standard forward vector. This angle can then be used to determine the direction of rotation, i.e., left or right. If the angle is greater than 180 degrees, it's right, while if it's less than or equal to 180 degrees, it's left. Furthermore, we can perform a vector cross product between the current heading vector and the standard forward vector to determine the rotation angle.
[0070] After obtaining the rotation direction and rotation angle, the first rotation control parameter of the virtual camera for the forward direction can be determined. The first rotation control parameter can be the rotation control parameter required for the virtual camera to rotate from the current heading vector to the standard forward vector.
[0071] Among them, the first rotation control parameter can rotate the required position and angle parameters, that is, the three-dimensional space coordinates and the rotation angle, which can be parameters in the form of quaternions, and can be composed of x (horizontal axis coordinate at the end of rotation), y (vertical axis coordinate at the end of rotation), z (vertical axis coordinate at the end of rotation), and w (rotation angle required for rotation).
[0072] Specifically, the following can be adopted:
[0073] QuaternionrotateForwardToDesiredForward=
[0074] rotationBetweenVectors(Vector3.forward(),start)
[0075] Among them, Quaternion represents the quaternion, rotateForwardToDesiredForward represents the first rotation control parameter, rotationBetweenVectors is a function that calculates the quaternion between two vectors, Vector3.forward() represents the standard forward vector, and start represents the current heading vector after reassignment.
[0076] Sub-step 12: determining a second rotation control parameter of the virtual camera in the upward direction.
[0077] In a specific implementation, the upward direction is the up direction of the virtual camera, which is a direction perpendicular to the vehicle screen, and thus the second rotation control parameter of the virtual camera for the upward direction can be determined.
[0078] In one embodiment of the present invention, sub-step 12 may include:
[0079] Sub-step 121, obtaining the current upward direction vector of the virtual camera.
[0080] In a specific implementation, the current upward direction vector of the virtual camera itself, that is, the vector of the virtual camera currently in the upward direction, can be determined as follows:
[0081] Vector3 up = camera.up.cpy()
[0082] Among them, up and camera.up represent the current upward direction vector of the virtual camera.
[0083] In one example, in order to change the original value of the variable in subsequent operations, up can be reassigned as follows:
[0084] Vector3 end=new Vector3(up.x,up.y,up.z)
[0085] Among them, end represents the current upward direction vector after reassignment, new is the assignment function, up.x, up.y, and up.z are the horizontal axis coordinate, vertical axis coordinate, and vertical axis coordinate of the current upward direction vector respectively.
[0086] Sub-step 122, determining the target upward direction vector.
[0087] In a specific implementation, a target upward direction vector of the virtual camera may be determined. The target upward direction vector may be a vector to which the virtual camera needs to move in an upward direction.
[0088] In one embodiment of the present invention, sub-step 122 may include:
[0089] Sub-step 1221 : obtaining a target upward direction vector according to the first rotation control parameter and a preset standard upward direction vector.
[0090] The standard upward direction vector may be a vector with a length of 1 in the upward direction, for example, its coordinates may be (0, 1, 0), which are coordinates with reference to the vehicle screen.
[0091] In a specific implementation, a preset standard upward direction vector can be obtained. Since the first rotation control parameter can be a parameter in the form of a quaternion, the quaternion can be converted into a 2*3 matrix (i.e., the values of x (horizontal axis coordinate at the end of rotation), y (vertical axis coordinate at the end of rotation), and z (vertical axis coordinate at the end of rotation) are obtained), and then multiplied by the standard upward direction vector to obtain the target upward direction vector. Specifically, the following method can be used:
[0092] Vector3 newUp=rotateVector(rotateForwardToDesiredForward,Vector3.up())
[0093] Among them, newUp represents the target upward direction vector, rotateVector() is a function for calculating the vector, rotateForwardToDesiredForward represents the first rotation control parameter, and Vector3.up() represents the standard upward direction vector.
[0094] Sub-step 123 : determining a second rotation control parameter of the virtual camera in the upward direction according to the current upward direction vector and the target upward direction vector.
[0095] After obtaining the current and target upward vectors, we can calculate the angle between them. This angle can then be used to determine the direction of rotation, i.e., left or right. If the angle is greater than 180 degrees, it indicates right rotation, while if it is less than or equal to 180 degrees, it indicates left rotation. Furthermore, we can perform a vector cross product of the current and target upward vectors to determine the rotation angle.
[0096] After obtaining the rotation direction and rotation angle, the second rotation control parameter of the virtual camera for the upward direction can be determined. The second rotation control parameter can be the rotation control parameter required for the virtual camera to rotate from the current upward direction vector to the target upward direction vector.
[0097] Among them, the second rotation control parameter can rotate the required position and angle parameters, that is, the three-dimensional space coordinates and the rotation angle, which can be parameters in the form of quaternions, and can be composed of x (horizontal axis coordinate at the end of rotation), y (vertical axis coordinate at the end of rotation), z (vertical axis coordinate at the end of rotation), and w (rotation angle required for rotation).
[0098] In one embodiment of the present invention, sub-step 123 may include:
[0099] Sub-step 1231: Determine a first plane based on the current heading vector and the current upward direction vector, and determine a first normal vector perpendicular to the first plane.
[0100] After determining the current facing vector and the current upward direction vector of the virtual camera, a cross product calculation can be performed on the current facing vector and the current upward direction vector to obtain a first normal vector perpendicular to the first plane formed by the two vectors. The method can be as follows:
[0101] Vector3 rightInWorld=Vector3.cross(start,end)
[0102] Among them, rightInWorld represents the first normal vector, and cross() is a function that requests the normal vector.
[0103] Sub-step 1232: Determine a second plane based on the first normal vector and the current orientation vector, and determine a second normal vector perpendicular to the second plane.
[0104] After obtaining the first normal vector, you can perform a cross product calculation on the first normal vector and the current heading vector to obtain a second normal vector perpendicular to the second plane formed by the two vectors. Specifically, you can use the following method:
[0105] Vector3desiredUpInWorld=Vector3.cross(rightInWorld,start)
[0106] Here, desiredUpInWorld represents the second normal vector.
[0107] Sub-step 1233 , determining a second rotation control parameter of the virtual camera in the upward direction according to the current upward direction vector, the target upward direction vector, and the second normal vector.
[0108] After obtaining the second normal vector, the second rotation control parameter of the virtual camera in the upward direction can be determined by combining the current upward direction vector, the target upward direction vector, and the second normal vector. Specifically, the following method can be used:
[0109] Quaternion rotateNewUpToUpwards=rotationBetweenVectors(newUp,desiredUpInWorld)
[0110] Among them, Quaternion represents the quaternion, rotateNewUpToUpwards represents the second rotation control parameter, rotationBetweenVectors is a function for calculating the quaternion between two vectors, newUp represents the target upward direction vector, and desiredUpInWorld represents the second normal vector.
[0111] Sub-step 13: obtaining target rotation control parameters for the target virtual 3D model according to the first rotation control parameter and the second rotation control parameter.
[0112] Since both the first rotation control parameter and the second rotation control parameter can be parameters in the form of quaternions, after obtaining the first rotation control parameter and the second rotation control parameter, the two quaternions can be multiplied to obtain the final quaternion, that is, the target rotation control parameter. Specifically, the method can be as follows:
[0113] Quaternion quaternion=multiply(rotateNewUpToUpwards,rotateForwardToDesiredForward)
[0114] Among them, quaternion represents the target rotation control parameter, that is, the final quaternion, multiply() is a function of multiplication operation, rotateForwardToDesiredForward represents the first rotation control parameter, and rotateNewUpToUpwards represents the second rotation control parameter.
[0115] Step 103 : Control the target virtual 3D model to rotate according to the target rotation control parameter, so that the target virtual 3D model is always presented in the first style.
[0116] After determining the target rotation control parameters, the target rotation control parameters can be used to control the rotation of the target virtual 3D model. It should be noted that controlling the rotation of the target virtual 3D model does not refer to the rotation of the presented perspective, but the rotation of the target virtual 3D model itself.
[0117] If the target virtual 3D model is presented in the first style when the virtual camera perspective is not rotated, and the target virtual 3D model itself is not rotated when the virtual camera perspective is rotated, the target virtual 3D model will be presented to the user in a different style, such as Figure 2a The target virtual 3D model is the "P" sign used to indicate parking spaces in the 3D parking interface. After the virtual camera's perspective rotates, the virtual camera itself does not rotate, and a side view of the "P" sign is presented, affecting the user's visual experience.
[0118] When the virtual camera angle rotates, the target virtual 3D model also rotates, and the presented target virtual 3D model is corrected so that it remains presented to the user in the first style, such as Figure 2b The target virtual 3D model is the "P" sign used to indicate parking spaces in the 3D parking interface. After the virtual camera perspective rotates, it also rotates itself, presenting a front view of the "P" sign, allowing users to clearly see the "P" sign.
[0119] In one embodiment of the present invention, the target rotation control parameter is a parameter in the form of a quaternion, which may be composed of x (the horizontal axis coordinate at the end of the rotation), y (the vertical axis coordinate at the end of the rotation), z (the vertical axis coordinate at the end of the rotation), and w (the rotation angle required for the rotation). Then, step 103 may include:
[0120] Sub-step 21, converting the target rotation control parameters into a target matrix.
[0121] Since the virtual 3D model is drawn through matrices, the target rotation control parameters in quaternion form can be converted into a 4*4 target matrix, and a float array with a fixed length of 16 can be defined to store the 4*4 matrix data. The specific method can be as follows:
[0122] Matrix matrix=toMatrix(m,quaternion.x,quaternion.y,quaternion.z,quaternion.w)
[0123] Among them, matrix represents the target matrix, toMatrix() represents the conversion of the quaternion into a matrix, and quaternion.x, quaternion.y, quaternion.z, and quaternion.w represent the horizontal axis coordinate, vertical axis coordinate, vertical axis coordinate, and rotation angle of the quaternion as the target rotation control parameters, respectively.
[0124] Sub-step 22: controlling the target virtual 3D model to rotate according to the target matrix.
[0125] After obtaining the target matrix, you can assign the target matrix to the target virtual 3D model to be rotated, use the drawing code to draw it, and then control the rotation of the target virtual 3D model so that the target virtual 3D model always faces the camera and realizes gaze rotation. The specific method is as follows:
[0126] mModelInstanceP.transform.mul(matrix)
[0127] Among them, mModelInstanceP.transform.mul() represents assigning the target matrix to the target virtual 3D model, and matrix is the target matrix.
[0128] In an embodiment of the present invention, a 3D view based on a virtual camera perspective is presented to a user, wherein the 3D view has a target virtual 3D model, and the target virtual 3D model is presented in a first style. When rotation control of the virtual camera perspective is detected, target rotation control parameters for the target virtual 3D model are determined, and then, according to the target rotation control parameters, the target virtual 3D model is controlled to rotate so that the target virtual 3D model remains presented in the first style. This realizes rotation control of the virtual 3D model in the 3D view, enables the virtual 3D model to move with the virtual camera perspective, avoids the virtual 3D model presenting different styles to the user due to changes in perspective, improves the user's visual experience, and ensures safe driving of the vehicle.
[0129] Reference Figure 3 , which shows a flowchart of a data processing method provided by an embodiment of the present invention, which may specifically include the following steps:
[0130] Step 301: presenting a 3D view based on a virtual camera perspective to a user, wherein the 3D view includes a target virtual 3D model, and the target virtual 3D model is presented in a first style.
[0131] Step 302: When the rotation control of the virtual camera viewing angle is detected, the current orientation vector of the virtual camera is obtained.
[0132] Step 303: Determine a first rotation control parameter of the virtual camera in the forward direction according to the current heading vector and a preset standard forward vector.
[0133] Step 304: Obtain the current upward direction vector of the virtual camera.
[0134] Step 305: Obtain a target upward direction vector according to the first rotation control parameter and a preset standard upward direction vector.
[0135] Step 306: Determine a first plane based on the current heading vector and the current upward direction vector, and determine a first normal vector perpendicular to the first plane.
[0136] Step 307: Determine a second plane according to the first normal vector and the current orientation vector, and determine a second normal vector perpendicular to the second plane.
[0137] Step 308 : Determine a second rotation control parameter of the virtual camera in the upward direction according to the current upward direction vector, the target upward direction vector, and the second normal vector.
[0138] Step 309 : Obtain target rotation control parameters for the target virtual 3D model according to the first rotation control parameter and the second rotation control parameter.
[0139] Step 310: Convert the target rotation control parameter into a target matrix. The target rotation control parameter is a parameter in the form of quaternion.
[0140] Step 311: Control the target virtual 3D model to rotate according to the target matrix, so that the target virtual 3D model is still presented in the first style.
[0141] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0142] Reference Figure 4, which shows a schematic structural diagram of a data processing device provided by an embodiment of the present invention, which may specifically include the following modules:
[0143] The 3D view presenting module 401 is configured to present a 3D view based on a virtual camera perspective to a user, wherein the 3D view includes a target virtual 3D model, and the target virtual 3D model is presented in a first style.
[0144] The target rotation control parameter determination module 402 is configured to determine target rotation control parameters for the target virtual 3D model when rotation control of the virtual camera viewing angle is detected.
[0145] The rotation control module 403 is configured to control the target virtual 3D model to rotate according to the target rotation control parameter, so that the target virtual 3D model is presented in the first style.
[0146] In one embodiment of the present invention, the target rotation control parameter determination module 402 may include:
[0147] The first rotation control parameter determination submodule is used to determine a first rotation control parameter of the virtual camera in the forward direction.
[0148] The second rotation control parameter determination submodule is used to determine a second rotation control parameter of the virtual camera in an upward direction.
[0149] Combined with the target parameter determination submodule, it is used to obtain the target rotation control parameters for the target virtual 3D model according to the first rotation control parameter and the second rotation control parameter.
[0150] In one embodiment of the present invention, the first rotation control parameter determination submodule may include:
[0151] The current orientation vector obtaining unit is used to obtain the current orientation vector of the virtual camera.
[0152] Combined with the first parameter determination unit, it is used to determine the first rotation control parameter of the virtual camera for the forward direction according to the current orientation vector and the preset standard forward vector.
[0153] In one embodiment of the present invention, the second rotation control parameter determination submodule may include:
[0154] The current upward direction vector obtaining unit is used to obtain the current upward direction vector of the virtual camera.
[0155] The target upward direction vector determining unit is used to determine the target upward direction vector.
[0156] Combined with the second parameter determination unit, it is used to determine the second rotation control parameter of the virtual camera in the upward direction according to the current upward direction vector and the target upward direction vector.
[0157] In one embodiment of the present invention, the second parameter determination unit may include:
[0158] The first normal vector determining subunit is used to determine a first plane according to the current orientation vector and the current upward direction vector, and to determine a first normal vector perpendicular to the first plane.
[0159] The second normal vector determining subunit is used to determine a second plane according to the first normal vector and the current orientation vector, and to determine a second normal vector perpendicular to the second plane.
[0160] The second parameter determination subunit in combination with the normal is used to determine the second rotation control parameter of the virtual camera for the upward direction according to the current upward direction vector, the target upward direction vector, and the second normal vector.
[0161] In one embodiment of the present invention, the target upward direction vector determining unit may include:
[0162] Combined with the target upward direction vector determination subunit, it is used to obtain the target upward direction vector according to the first rotation control parameter and the preset standard upward direction vector.
[0163] In one embodiment of the present invention, the target rotation control parameter is a parameter in the form of a quaternion. The rotation control module 403 may include:
[0164] The target matrix conversion submodule is used to convert the target rotation control parameters into the target matrix.
[0165] Combined with the matrix rotation control submodule, it is used to control the rotation of the target virtual 3D model according to the target matrix.
[0166] In an embodiment of the present invention, a 3D view based on a virtual camera perspective is presented to a user, wherein the 3D view has a target virtual 3D model, and the target virtual 3D model is presented in a first style. When rotation control of the virtual camera perspective is detected, target rotation control parameters for the target virtual 3D model are determined, and then, according to the target rotation control parameters, the target virtual 3D model is controlled to rotate so that the target virtual 3D model remains presented in the first style. This realizes rotation control of the virtual 3D model in the 3D view, enables the virtual 3D model to move with the virtual camera perspective, avoids the virtual 3D model presenting different styles to the user due to changes in perspective, improves the user's visual experience, and ensures safe driving of the vehicle.
[0167] An embodiment of the present invention further provides a vehicle, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the above data processing method is implemented.
[0168] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above data processing method is implemented.
[0169] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0170] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0171] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0172] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the process in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0173] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0174] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0175] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0176] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0177] The above is a detailed introduction to the provided data processing method and device. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.
Claims
1. A data processing method, characterized in that: The method comprises: Presenting a 3D view based on a virtual camera perspective to a user, wherein the 3D view includes a target virtual 3D model, and the target virtual 3D model is presented in a first style; When a rotation control of the virtual camera viewing angle is detected, determining a target rotation control parameter for the target virtual 3D model; controlling the target virtual 3D model to rotate according to the target rotation control parameter so that the target virtual 3D model remains presented in the first style; The determining of the target rotation control parameters for the target virtual 3D model includes: Determining a first rotation control parameter of the virtual camera with respect to a forward direction; determining a second rotation control parameter of the virtual camera with respect to an upward direction; A target rotation control parameter for the target virtual 3D model is obtained according to the first rotation control parameter and the second rotation control parameter.
2. The method according to claim 1, characterized in that The determining of a first rotation control parameter of the virtual camera in a forward direction includes: Obtaining the current orientation vector of the virtual camera; A first rotation control parameter of the virtual camera with respect to a forward direction is determined according to the current orientation vector and a preset standard forward vector.
3. The method according to claim 2, characterized in that The determining of a second rotation control parameter of the virtual camera in an upward direction includes: Get the current upward direction vector of the virtual camera; Determine the target upward direction vector; A second rotation control parameter of the virtual camera with respect to the upward direction is determined according to the current upward direction vector and the target upward direction vector.
4. The method according to claim 3, characterized in that The determining, according to the current upward direction vector and the target upward direction vector, a second rotation control parameter of the virtual camera in the upward direction includes: Determine a first plane according to the current heading vector and the current upward direction vector, and determine a first normal vector perpendicular to the first plane; Determine a second plane according to the first normal vector and the current heading vector, and determine a second normal vector perpendicular to the second plane; A second rotation control parameter of the virtual camera with respect to the upward direction is determined according to the current upward direction vector, the target upward direction vector, and the second normal vector.
5. The method according to claim 3 or 4, characterized in that Determining the target upward direction vector includes: A target upward direction vector is obtained according to the first rotation control parameter and a preset standard upward direction vector.
6. The method according to any one of claims 1 to 4, characterized in that The target rotation control parameter is a parameter in the form of a quaternion, and controlling the target virtual 3D model to rotate according to the target rotation control parameter includes: Converting the target rotation control parameters into a target matrix; According to the target matrix, the target virtual 3D model is controlled to rotate.
7. A data processing device, characterized in that: The device comprises: a 3D view rendering module, configured to present a 3D view based on a virtual camera perspective to a user, wherein the 3D view includes a target virtual 3D model, and the target virtual 3D model is presented in a first style; a target rotation control parameter determination module, configured to determine target rotation control parameters for the target virtual 3D model when a rotation control of the virtual camera viewing angle is detected; a rotation control module, configured to control the target virtual 3D model to rotate according to the target rotation control parameter, so that the target virtual 3D model remains presented in the first style; The target rotation control parameter determination module further includes: A first rotation control parameter determination submodule, configured to determine a first rotation control parameter of the virtual camera for a forward direction; A second rotation control parameter determination submodule, configured to determine a second rotation control parameter of the virtual camera in an upward direction; Combined with the target parameter determination submodule, it is used to obtain the target rotation control parameters for the target virtual 3D model according to the first rotation control parameter and the second rotation control parameter.
8. A vehicle, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the method for data processing according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data processing method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Virtual reality equipment and sight line following method for object in virtual reality scene
CN112817453A