Custom gesture interaction method on iOS system and related device

By fixing the position of the 3D rendering engine's camera and 3D model on the iOS system and adding interactive gestures to the 3D model, the problem of inconsistent interaction and state of 3D model is solved, and a stable and consistent interactive experience of 3D models is achieved.

CN119597156AActive Publication Date: 2025-03-11HUNAN MANGO DIGITAL INTELLIGENCE ART TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510142526.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-03-11
Estimated Expiration
2045-02-10

AI Technical Summary

Technical Problem

On iOS system, the interaction and state of the 3D model are inconsistent with the camera when rotating it, resulting in the problem that the model interaction gestures are inconsistent with the state of the 3D model.

Method used

By fixing the camera that comes with the 3D rendering engine at the origin of the 3D coordinate system scene and fixing the 3D model at the position of the 3D coordinate system scene with the camera as the origin, camera interaction is prohibited, and model interaction gestures are added to the 3D model to achieve direct gesture interaction between the user and the 3D model.

Benefits of technology

It ensures the consistency between the interaction and state of the 3D model in any scene, avoids the problem of inconsistency in model state caused by camera rotation, and achieves smooth interaction between the user and the 3D model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597156A_ABST
    Figure CN119597156A_ABST
Patent Text Reader

Abstract

The invention discloses a user-defined gesture interaction method on an iOS system and a related device, and is applied to the field of operating systems. According to the invention, the camera of the 3D rendering engine can be fixed at the original point of the 3D coordinate system scene of the iOS system; fixing a 3D model at a first position of a 3D coordinate system scene taking the camera as an original point; and adding a model interaction gesture in the 3D model. The position between the camera and the 3D model can be redefined by forbidding the camera interaction mode of the 3D rendering engine, and the model interaction gesture is added to the 3D model, so that the interaction mode in the 3D rendering engine is transferred from the camera to the 3D model, a user can perform gesture interaction with the 3D model, and the user experience is improved. And the interaction and state consistency of the 3D model in any scene is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of operating systems, and in particular to a custom gesture interaction method and related devices on an iOS system. Background Art

[0002] When the iOS platform renders 3D models based on the 3D rendering engine, the system's built-in model interaction implementation method is based on camera interaction. When the camera rotates, the 3D coordinate system where the 3D model is located rotates, which affects all nodes in the 3D coordinate system, causing the position of the 3D model light tube node to rotate, resulting in inconsistencies between the model interaction gesture and the 3D model state, etc. Therefore, how to ensure the consistency of the interaction and state of the 3D model in any scenario has become a technical problem that people in this field need to solve urgently. Summary of the invention

[0003] In view of the above problems, the present invention provides a method and related apparatus for customizing gesture interaction on an iOS system, which overcomes the above problems or at least partially solves the above problems.

[0004] In a first aspect, a custom gesture interaction method on an iOS system includes:

[0005] The camera of the 3D rendering engine is fixed at the origin of the 3D coordinate system scene of the iOS system to prohibit the use of the camera interaction mode in the 3D rendering engine, wherein the imaging direction of the camera is along the negative direction of the z-axis;

[0006] Fixing the 3D model at a first position of a 3D coordinate system scene with the camera as the origin, so as to realize imaging of the 3D model in the 3D coordinate system scene, wherein the first position is a coordinate represented based on the SCNVector3 structure;

[0007] A model interaction gesture is added to the 3D model to facilitate the user to perform gesture interaction with the 3D model in the 3D rendering engine.

[0008] Optionally, in some optional embodiments, after fixing the 3D model at a first position of a 3D coordinate system scene with the camera as the origin, the method further includes:

[0009] Calculate the difference between the maximum bounding box and the minimum bounding box in each 3D model to obtain a vector size, wherein the vector size includes a length, a width, and a height;

[0010] determining a maximum value from among said length, width and height;

[0011] The 3D models are placed in a bounding box with a vector size of 1, so that the scaling ratio of each of the 3D models is unified to 1 / maximum value.

[0012] Optionally, in some optional implementations, adding a model interaction gesture to the 3D model to facilitate gesture interaction between the user and the 3D model in the 3D rendering engine includes:

[0013] Using the gesture adding method defined by the iOS system, adding a model interaction gesture of the iOS system to the 3D model;

[0014] The maximum finger index for the model interaction gesture recognition is set to 1, so that the user can perform single-finger gesture interaction with the 3D model.

[0015] Optionally, in some optional implementations, setting the maximum finger index of the model interaction gesture recognition to 1, so that the user can perform a single-finger gesture interaction with the 3D model, includes:

[0016] Set the maximum finger index of the model interactive gesture recognition to 1;

[0017] After obtaining the single-finger sliding data of the user on the screen coordinate system, calculating the rotation axis of the 3D model and the finger movement distance corresponding to the single-finger sliding data in the 3D model according to the X-axis offset distance and the Y-axis offset distance in the single-finger sliding data;

[0018] Calculating the rotation angle of the 3D model according to the finger movement distance;

[0019] Calculating a rotation factor of the 3D model according to the rotation angle of the 3D model;

[0020] Obtaining a quaternion of the single-finger sliding data in the 3D coordinate system scene according to the rotation axis, the angle, and the rotation factor;

[0021] The 3D model is controlled to rotate based on the quaternion, so that the user can interact with the 3D model through a single-finger gesture.

[0022] Optionally, in some optional implementations, adding a model interaction gesture to the 3D model to facilitate gesture interaction between the user and the 3D model in the 3D rendering engine includes:

[0023] Using the gesture adding method defined by the iOS system, adding a model interaction gesture of the iOS system to the 3D model;

[0024] The maximum finger index for the model interaction gesture recognition is set to 2, so that the user can perform two-finger sliding interaction with the 3D model.

[0025] Optionally, in some optional implementations, setting the maximum finger index of the model interaction gesture recognition to 2, so that the user can perform two-finger sliding interaction with the 3D model, includes:

[0026] Set the maximum finger index of the model interactive gesture recognition to 2;

[0027] After obtaining the two-finger sliding data of the user on the screen coordinate system, converting the position of the 3D model from the 3D coordinate system scene to the screen coordinate system;

[0028] Calculate the final position of the 3D model in the screen coordinate system as the two fingers slide according to the position of the 3D model in the screen coordinate system and the X-axis offset distance and the Y-axis offset distance in the two-finger sliding data;

[0029] The final position of the 3D model in the screen coordinate system is converted to a corresponding position in the 3D coordinate system scene, so that the user can perform two-finger sliding interaction with the 3D model.

[0030] Optionally, in some optional implementations, adding a model interaction gesture to the 3D model to facilitate gesture interaction between the user and the 3D model in the 3D rendering engine includes:

[0031] Using the gesture adding method defined by the iOS system, adding a model interaction gesture of the iOS system to the 3D model;

[0032] The zoom size attribute of the 3D model is set equal to the product of the default zoom ratio of the model interaction gesture and the unified zoom ratio of each 3D model, so that the user can perform two-finger zoom interaction with the 3D model.

[0033] In a second aspect, a custom gesture interaction device on an iOS system includes: a camera interaction prohibition unit, a model position fixing unit, and an interaction gesture adding unit;

[0034] The camera interaction prohibition unit is used to fix the camera of the 3D rendering engine at the origin of the 3D coordinate system scene of the iOS system to prohibit the use of the camera interaction mode in the 3D rendering engine, wherein the imaging direction of the camera is the negative direction along the z-axis;

[0035] The model position fixing unit is used to fix the 3D model at a first position of a 3D coordinate system scene with the camera as the origin, so as to realize imaging of the 3D model in the 3D coordinate system scene, wherein the first position is a coordinate represented based on a SCNVector3 structure;

[0036] The interactive gesture adding unit is used to add a model interactive gesture to the 3D model to facilitate the user to perform gesture interaction with the 3D model in the 3D rendering engine.

[0037] In a third aspect, a computer-readable storage medium stores a program, which, when executed by a processor, implements any of the above-mentioned custom gesture interaction methods on an iOS system.

[0038] In a fourth aspect, an electronic device comprises at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other via the bus; and the processor is used to call program instructions in the memory to execute any of the above-mentioned custom gesture interaction methods on the iOS system.

[0039] By means of the above technical scheme, the present invention provides a method and related device for custom gesture interaction on an iOS system, which can fix the camera of a 3D rendering engine at the origin of a 3D coordinate system scene of an iOS system to prohibit the use of a camera interaction mode in the 3D rendering engine, wherein the direction of the camera imaging is along the negative direction of the z-axis; fix a 3D model at the first position of a 3D coordinate system scene with the camera as the origin to realize the imaging of the 3D model in the 3D coordinate system scene, wherein the first position is a coordinate represented by a SCNVector3 structure; and add a model interaction gesture to the 3D model so that the user can perform gesture interaction with the 3D model in the 3D rendering engine. It can be seen from this that the present invention can redefine the position between the camera and the 3D model by disabling the camera interaction mode of the 3D rendering engine, and add a model interaction gesture to the 3D model, so that the interaction mode in the 3D rendering engine is transferred from the camera to the 3D model, and the user can perform gesture interaction with the 3D model, thereby ensuring the consistency of the interaction and state of the 3D model in any scene.

[0040] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0042] Figure 1 A flowchart of a first custom gesture interaction method on an iOS system provided by the present invention is shown;

[0043] Figure 2 A schematic diagram of the node structure of an SCNNode provided by the present invention is shown;

[0044] Figure 3 A flowchart of a second custom gesture interaction method on an iOS system provided by the present invention is shown;

[0045] Figure 4 A flowchart of a third custom gesture interaction method on an iOS system provided by the present invention is shown;

[0046] Figure 5 A flowchart of a fourth custom gesture interaction method on an iOS system provided by the present invention is shown;

[0047] Figure 6 A schematic diagram of the structure of a custom gesture interaction device on an iOS system provided by the present invention is shown;

[0048] Figure 7 A structural schematic diagram of an electronic device provided by the present invention is shown. DETAILED DESCRIPTION

[0049] When the iOS platform renders 3D models based on the 3D rendering engine, the system's built-in model interaction implementation method is based on camera interaction. When the camera rotates, the 3D coordinate system where the 3D model is located rotates, which affects all nodes in the 3D coordinate system, causing the position of the 3D model light tube node to rotate, resulting in inconsistencies between the model interaction gesture and the state of the 3D model.

[0050] Regarding problem 1, the built-in interaction mode of the 3D rendering engine of the iOS system is based on the interaction of the camera. When the camera rotates, it causes the rotation of the entire 3D coordinate system, which will affect all nodes in the 3D coordinate system, resulting in the position rotation of the model nodes, the inconsistency between the model interaction gesture and the state of the 3D model, etc. The present invention prohibits the built-in camera interaction mode of the 3D rendering engine and adds a UIGestureRecognizer gesture to the 3D model, so as to realize the transfer of the interaction mode in the 3D rendering engine from the camera to the 3D model.

[0051] For question 2, when the camera interaction is prohibited in the 3D rendering engine of the iOS system, the model does not support any interactive behavior. The present invention implements pinch-to-zoom by adding UIPinchGestureRecognizer to the 3D model itself, adds UIPanGestureRecognizer gesture to implement single-finger rotation and translation, and implements click home by UITapGestureRecognizer gesture.

[0052] Regarding question 3, the conflict between single-finger rotation and two-finger translation implemented by UIPanGestureRecognizer in the custom gestures of the model in the 3D rendering engine of the iOS system, and the conflict between UIPinchGestureRecognizer and UIPanGestureRecognizer during two-finger translation and scaling. The present invention solves the conflict between single-finger rotation and two-finger translation of the model by setting the number of fingers recognized by UIPanGestureRecognizer, and solves the conflict between scaling and translation of the model by simultaneously recognizing both UIPinchGestureRecognizer and UIPanGestureRecognizer during two-finger interaction.

[0053] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0054] like Figure 1 As shown, the present invention provides a custom gesture interaction method on an iOS system, including: S100, S200 and S300;

[0055] S100, fixing the camera of the 3D rendering engine at the origin of the 3D coordinate system scene of the iOS system to prohibit the use of the camera interaction mode in the 3D rendering engine, wherein the direction of the camera imaging is along the negative direction of the z-axis;

[0056] Optionally, the 3D coordinate system of the iOS system adopts a right-handed Cartesian coordinate system. The X-axis represents the horizontal position of the object, the Y-axis represents the vertical position of the object, and the Z-axis represents the depth position of the object, and the present invention does not limit this.

[0057] Optionally, the scene in the present invention refers to SCNScene, which provides a scene for 3D model rendering and display in the iOS system. The content that the 3D rendering engine (e.g., SceneKit engine) of the iOS system needs to render needs to be bound to SCNNode, which is defined as a node. The overall structure of each node is as follows: Figure 2 shown.

[0058] Optionally, the 3D rendering engine mentioned in the present invention is a well-known engine in the field of iOS systems, and the present invention will not make any detailed descriptions on this. For details, please refer to the relevant descriptions in the field.

[0059] S200, fixing the 3D model at a first position of a 3D coordinate system scene with the camera as the origin, so as to realize imaging of the 3D model in the 3D coordinate system scene, wherein the first position is a coordinate represented by a SCNVector3 structure;

[0060] Optionally, the iOS system creates a 3D coordinate system through SCNScene. When a node is added to the coordinate system, the position of the node is represented by three numbers. These three components are represented by the SCNVector3 (SCNVector3 defines three values: x, y and z. The corresponding values ​​are the X-axis, Y-axis and Z-axis in the 3D coordinate system) structure, which defines the position of the node on the x, y and z axes. The present invention no longer uses the camera interaction method of the 3D rendering engine. The camera is fixed at the origin of the entire scene in the 3D coordinate system, that is, SCNVector (0, 0, 0), and the direction of camera imaging is along the negative direction of the z axis. The 3D model (which can be a GLTF 3D model) is placed at the first position to achieve the imaging effect of the model.

[0061] Optionally, the first position mentioned in the present invention can be a position in the negative direction of the Z axis. Since the camera is fixed at the position of (0, 0, 0), facing the negative direction of the Z axis, the model must be set in the negative direction of the Z axis to form an image. For example, the model can be at the position of (0, 0, -2.6). Of course, the present invention is not limited to this position, and can be set according to actual needs. Generally speaking, the closer the position of the model is to the origin, the larger the model is; the farther the position of the model is from the origin, the smaller the model is, and the present invention does not limit this.

[0062] Optionally, the iOS system defaults to implementing model interaction behavior by adjusting the angle and position of the camera. The solution of the present invention does not adjust the position and angle of the camera, but modifies the position and angle of the model in real time. Therefore, the present invention needs to fix the camera position at the origin of the entire scene.

[0063] Optionally, the reason why the present invention places the 3D model at the first position is that the position of the camera along the Z-axis is more conducive to the presentation of the model. As for whether the value on the Z-axis is -2.6, the present invention does not limit this, and specific adjustments can be made according to parameters such as the focal length of the camera.

[0064] Optionally, in some optional embodiments, after S200, the method further includes: step 1.1, step 1.2 and step 1.3;

[0065] Step 1.1, calculating the difference between the maximum bounding box and the minimum bounding box in each 3D model to obtain a vector size, wherein the vector size includes length, width and height;

[0066] Optionally, the bounding box can be understood as a rectangular box, and the 3D model is placed in this rectangular box. Due to different 3D models, the required box size is different. Therefore, the present invention can determine the maximum bounding box and the minimum bounding box from each bounding box, and then calculate the difference between the maximum bounding box and the minimum bounding box. It should be noted that: each bounding box has a corresponding length, width and height, and measuring the difference between two bounding boxes is to calculate the difference in length, the difference in width and the difference in height, and the present invention is not limited to this.

[0067] For example, the length, width and height of the maximum bounding box are 10, 10, 5 respectively, and the length, width and height of the minimum bounding box are 5, 4, 3 respectively. Then the length, width and height of the calculated vector size are 5 (10-5), 6 (10-4), 2 (5-3) respectively. The present invention is not limited to this.

[0068] Step 1.2, determining a maximum value from the length, width and height;

[0069] Step 1.3: Place the 3D models in a bounding box with a vector size of 1, so that the scaling ratio of each 3D model is unified to 1 / maximum value.

[0070] Optionally, in order to ensure the consistency of model size, the present invention needs to place each 3D model in a bounding box of the same size, that is, a bounding box with a vector size of 1, so that it can be ensured that each 3D model has the same size when viewed from the outside.

[0071] Optionally, since all 3D models are scaled in bounding boxes of uniform size, the present invention needs to determine the scaling ratio of each 3D model in the bounding box. For example, the length, width and height of the above vector size are 5, 6, and 2 respectively, and the maximum value is 6. Therefore, the scaling ratio of the 3D model in the bounding box with a size of 1 is 1 / 6, and the present invention does not limit this.

[0072] S300: adding a model interaction gesture to the 3D model to facilitate gesture interaction between the user and the 3D model in the 3D rendering engine.

[0073] For example, Figure 3 As shown, in some optional embodiments, the S300 includes: S310 and S311;

[0074] S310, using a gesture adding method defined by the iOS system, adding a model interaction gesture of the iOS system to the 3D model;

[0075] Optionally, the model interaction gesture may be a sliding gesture defined by the iOS system API. The present invention may add the gesture through the gesture adding method addGesture() defined by the iOS system. The added gesture may be a UIPanGestureRecognizer gesture, which is not limited by the present invention.

[0076] S311. Setting a maximum finger index for the model interaction gesture recognition to 1, so that the user can perform single-finger gesture interaction with the 3D model.

[0077] Optionally, in some optional implementations, the S320 includes: step 2.1, step 2.2, step 2.3, step 2.4, step 2.5 and step 2.6;

[0078] Step 2.1, setting the maximum finger index of the model interactive gesture recognition to 1;

[0079] Step 2.2, after obtaining the single-finger sliding data of the user on the screen coordinate system, calculate the rotation axis of the 3D model and the finger movement distance corresponding to the single-finger sliding data in the 3D model according to the X-axis offset distance and the Y-axis offset distance in the single-finger sliding data;

[0080] Step 2.3, calculating the rotation angle of the 3D model according to the finger movement distance;

[0081] Step 2.4, calculating a rotation factor of the 3D model according to the rotation angle of the 3D model;

[0082] Step 2.5, obtaining the quaternion of the single-finger sliding data in the 3D coordinate system scene according to the rotation axis, the angle and the rotation factor;

[0083] Step 2.6: Control the 3D model to rotate based on the quaternion, so as to enable the user to perform single-finger gesture interaction with the 3D model.

[0084] Optionally, since the coordinate system of the finger interaction is a 2D screen coordinate system, the present invention needs to convert the finger sliding data into a 3D coordinate system.

[0085] Optionally, the offset distance of the finger on the X axis during sliding is defined as: distanceX (X axis offset distance), and the offset distance on the Y axis is defined as: distanceY (Y axis offset distance). According to distanceX and distanceY, the present invention can calculate the rotation axis of the model as: SCNVector (-distanceY, -distanceX, 0), and the finger moving distance as: sqrt (distanceX×distanceX+distanceY×distanceY), and the present invention does not limit this.

[0086] Optionally, after calculating the finger movement distance distance, the present invention can calculate the model rotation angle angle=distance×Double.pi / 180 according to the distance, wherein Double.pi is a definition of PI provided by the iOS system API, and Double.pi / 180 represents radians, which is not limited by the present invention.

[0087] Optionally, after calculating the above angle angle, the present invention can calculate the rotation factor factor=sin(angle / 2) according to the angle angle, and the present invention is not limited to this.

[0088] Optionally, the present invention can obtain a quaternion in a 3D coordinate system according to axis, angle and factor: SCNVector4(axis.x×factor, axis.y×factor, axis.z×factor, cos(angle / 2)). A quaternion is an extended complex number consisting of a real part and an imaginary part. A quaternion can be expressed as q=w+xi+yj+zk, where w is the real part and (x, y, z) is the component on the rotation axis corresponding to the imaginary part. The real part w represents the cosine value of the rotation angle, and the imaginary part (x, y, z) represents the product of the sine value of the rotation angle and the rotation axis. For example, in the quaternion q=cos(θ / 2)+u×sin(θ / 2), w=cos(θ / 2) represents the cosine value of the rotation angle, and (u×sin(θ / 2)) represents the product of the sine value of the rotation angle and the rotation axis. The model can realize single-finger sliding model rotation by rotating around itself according to the four elements.

[0089] For example, Figure 4 As shown, in some optional embodiments, the S300 includes: S320 and S321;

[0090] S320, using a gesture adding method defined by the iOS system, adding a model interaction gesture of the iOS system to the 3D model;

[0091] S321. Set a maximum finger index for the model interaction gesture recognition to 2, so that the user can perform two-finger sliding interaction with the 3D model.

[0092] Optionally, in some optional implementations, the S321 includes: step 3.1, step 3.2, step 3.3 and step 3.4;

[0093] Step 3.1, setting the maximum finger index of the model interactive gesture recognition to 2;

[0094] Step 3.2: after obtaining the two-finger sliding data of the user on the screen coordinate system, convert the position of the 3D model from the 3D coordinate system scene to the screen coordinate system;

[0095] Step 3.3, calculating the final position of the 3D model in the screen coordinate system as the two fingers slide according to the position of the 3D model in the screen coordinate system and the X-axis offset distance and the Y-axis offset distance in the two-finger sliding data;

[0096] Step 3.4: convert the final position of the 3D model in the screen coordinate system to a corresponding position in the 3D coordinate system scene, so as to enable the user to perform two-finger sliding interaction with the 3D model.

[0097] Optionally, the present invention can add a model interaction gesture to the model (the added gesture can be: UIPanGestureRecognizer gesture), and at the same time set the maximum finger index of gesture recognition to 2, so that the two-finger sliding interaction of the model can be realized.

[0098] Optionally, the offset distance on the X axis during two-finger sliding is: distanceX (X axis offset distance), and the offset distance on the Y axis is: distanceY (Y axis offset distance). The present invention first converts the position of the model from the 3D coordinate system to the 2D screen coordinate system. That is: nodeScreenPosition=projectPoint(node.position), where the projectPoint method is a method defined by the iOS system, and the present invention will not describe it in detail. Please refer to the relevant description in the field for details.

[0099] Optionally, the present invention may calculate the final position of the node in the 2D coordinate system according to the position of the node in the 2D screen coordinate system and the offset distance.

[0100] That is, nodeScreenPosition = SCNVector3 (nodeScreenPosition.x-distanceX, nodeScreenPosition.y-distanceY, nodeScreenPosition.z). It should be noted that: the position of the 3D model converted to the screen coordinate system, plus the offset distance of the finger in the screen coordinate system each time, can obtain the real-time position of the 3D model along with the finger in the screen coordinate system, and the present invention does not limit this.

[0101] Finally, the present invention converts the position of the node in the 2D screen coordinate system into the position in the 3D coordinate system, that is, nodeScenePosition=unprojectPoint(nodeScreenPosition), wherein the unprojectPoint method is a method defined by the iOS system, which is not described in detail in the present invention, and please refer to the relevant description in the art for details.

[0102] For example, Figure 5 As shown, in some optional embodiments, the S300 includes: S330 and S331;

[0103] S330, using a gesture adding method defined by the iOS system, adding a model interaction gesture of the iOS system to the 3D model;

[0104] S331. Set the zoom size attribute of the 3D model to be equal to the product of the default zoom ratio of the model interaction gesture and the unified zoom ratio of each 3D model, so as to facilitate the user to perform two-finger zoom interaction with the 3D model.

[0105] Optionally, the present invention may add a model interaction gesture to the model (the added gesture may be: UIPinchGestureRecognizer gesture), and then the two-finger zoom interaction of the model may be implemented.

[0106] Optionally, the present invention needs to multiply the scale of the finger by the scale of the model itself to obtain the final scaled size of the model, that is, scale = gesture.scale × node.currentScale, that is, the scaled size of the model to be finally displayed is multiplied by the scaled size according to the gesture based on the current scaled size of the model.

[0107] Optionally, the present invention finally achieves the effect of model scaling by setting the model scale attribute, that is, node.scale = SCNVector3 (scale, scale, scale). It should be noted that SCNVector3 three-dimensional vector represents the scaling of the 3D model on the three axes of X, Y and Z. The same value scale is used here to ensure that the scaling of the 3D model will not be deformed, and the present invention does not limit this.

[0108] like Figure 6 As shown, the present invention provides a custom gesture interaction device on an iOS system, comprising: a camera interaction prohibition unit 100, a model position fixing unit 200, and an interaction gesture adding unit 300;

[0109] The camera interaction prohibition unit 100 is used to fix the camera of the 3D rendering engine at the origin of the 3D coordinate system scene of the iOS system to prohibit the use of the camera interaction mode in the 3D rendering engine, wherein the imaging direction of the camera is along the negative direction of the z-axis;

[0110] The model position fixing unit 200 is used to fix the 3D model at a first position of a 3D coordinate system scene with the camera as the origin, so as to realize imaging of the 3D model in the 3D coordinate system scene, wherein the first position is a coordinate represented by a SCNVector3 structure;

[0111] The interactive gesture adding unit 300 is used to add a model interactive gesture to the 3D model, so as to facilitate the user to perform gesture interaction with the 3D model in the 3D rendering engine.

[0112] Optionally, in certain optional embodiments, the device further comprises: a vector size obtaining unit, a maximum value determining unit and a model reduction placement unit;

[0113] The vector size obtaining unit is used to calculate the difference between the maximum bounding box and the minimum bounding box in each 3D model after fixing the 3D model at the first position of the 3D coordinate system scene with the camera as the origin, so as to obtain a vector size, wherein the vector size includes length, width and height;

[0114] The maximum value determining unit is used to determine the maximum value from the length, width and height;

[0115] The model reduction placement unit is used to place the 3D model in a bounding box with a vector size of 1, so that the scaling ratio of each 3D model is unified to 1 / maximum value.

[0116] Optionally, in some optional implementations, the interactive gesture adding unit 300 includes: a first gesture adding subunit and a first gesture setting subunit;

[0117] The first gesture adding subunit is used to add a model interaction gesture of the iOS system to the 3D model using a gesture adding method defined by the iOS system;

[0118] The first gesture setting subunit is used to set the maximum finger index of the model interaction gesture recognition to 1, so that the user can perform single-finger gesture interaction with the 3D model.

[0119] Optionally, in certain optional embodiments, the first gesture setting subunit includes: a first finger index setting subunit, a first moving distance calculation subunit, an angle calculation subunit, a rotation factor calculation subunit, a quaternion determination subunit and a single-finger interaction subunit;

[0120] The first finger index setting subunit is used to set the maximum finger index of the model interaction gesture recognition to 1;

[0121] The first movement distance calculation subunit is used to calculate the rotation axis of the 3D model and the finger movement distance corresponding to the single-finger sliding data in the 3D model according to the X-axis offset distance and the Y-axis offset distance in the single-finger sliding data after obtaining the single-finger sliding data of the user on the screen coordinate system;

[0122] The angle calculation subunit is used to calculate the rotation angle of the 3D model according to the finger movement distance;

[0123] The rotation factor calculation subunit is used to calculate the rotation factor of the 3D model according to the rotation angle of the 3D model;

[0124] The quaternion determination subunit is used to obtain the quaternion of the single-finger sliding data in the 3D coordinate system scene according to the rotation axis, the angle and the rotation factor;

[0125] The single-finger interaction subunit is used to control the 3D model to rotate based on the quaternion, so as to enable the user to perform single-finger gesture interaction with the 3D model.

[0126] Optionally, in some optional implementations, the interactive gesture adding unit 300 includes: a second gesture adding subunit and a second gesture setting subunit;

[0127] The second gesture adding subunit is used to add a model interaction gesture of the iOS system to the 3D model using a gesture adding method defined by the iOS system;

[0128] The second gesture setting subunit is used to set the maximum finger index of the model interaction gesture recognition to 2, so that the user can perform two-finger sliding interaction with the 3D model.

[0129] Optionally, in certain optional embodiments, the second gesture setting subunit includes: a second finger index setting subunit, a coordinate system conversion subunit, a final position calculation subunit, and a two-finger sliding interaction subunit;

[0130] The second finger index setting subunit is used to set the maximum finger index of the model interaction gesture recognition to 2;

[0131] The coordinate system conversion subunit is used to convert the position of the 3D model from the 3D coordinate system scene to the screen coordinate system after obtaining the two-finger sliding data of the user on the screen coordinate system;

[0132] The final position calculation subunit is used to calculate the final position of the 3D model in the screen coordinate system as the two fingers slide according to the position of the 3D model in the screen coordinate system and the X-axis offset distance and the Y-axis offset distance in the two-finger sliding data;

[0133] The two-finger sliding interaction subunit is used to convert the final position of the 3D model in the screen coordinate system to a corresponding position in the 3D coordinate system scene, so as to enable the user to perform two-finger sliding interaction with the 3D model.

[0134] Optionally, in some optional implementations, the interactive gesture adding unit 300 includes: a third gesture adding subunit and a scaling attribute setting subunit;

[0135] The third gesture adding subunit is used to add a model interaction gesture of the iOS system to the 3D model using a gesture adding method defined by the iOS system;

[0136] The zoom attribute setting subunit is used to set the zoom size attribute of the 3D model equal to the product of the default zoom ratio of the model interaction gesture and the unified zoom ratio of each 3D model, so as to facilitate the user to perform two-finger zoom interaction with the 3D model.

[0137] The present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the program implements any of the above-mentioned custom gesture interaction methods on the iOS system.

[0138] like Figure 7As shown, the present invention provides an electronic device 70, which includes at least one processor 701, and at least one memory 702 and a bus 703 connected to the processor 701; wherein the processor 701 and the memory 702 communicate with each other through the bus 703; the processor 701 is used to call the program instructions in the memory 702 to execute any of the above-mentioned custom gesture interaction methods on the iOS system.

[0139] In the present invention, 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 such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0140] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system 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.

[0141] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined in the present invention may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown in the present invention, but will conform to the widest scope consistent with the principles and novel features disclosed in the present invention.

[0142] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A custom gesture interaction method on iOS system, characterized in that: include: The camera of the 3D rendering engine is fixed at the origin of the 3D coordinate system scene of the iOS system to prohibit the use of the camera interaction mode in the 3D rendering engine, wherein the imaging direction of the camera is along the negative direction of the z-axis; Fixing the 3D model at a first position of a 3D coordinate system scene with the camera as the origin, so as to realize imaging of the 3D model in the 3D coordinate system scene, wherein the first position is a coordinate represented based on the SCNVector3 structure; A model interaction gesture is added to the 3D model to facilitate the user to perform gesture interaction with the 3D model in the 3D rendering engine.

2. The method according to claim 1, characterized in that: After fixing the 3D model at a first position of a 3D coordinate system scene with the camera as an origin, the method further includes: Calculate the difference between the maximum bounding box and the minimum bounding box in each 3D model to obtain a vector size, wherein the vector size includes a length, a width, and a height; determining a maximum value from among said length, width and height; The 3D models are placed in a bounding box with a vector size of 1, so that the scaling ratio of each of the 3D models is unified to 1 / maximum value.

3. The method according to claim 1, characterized in that The step of adding a model interaction gesture to the 3D model so as to facilitate gesture interaction between the user and the 3D model in the 3D rendering engine includes: Using the gesture adding method defined by the iOS system, adding a model interaction gesture of the iOS system to the 3D model; The maximum finger index for the model interaction gesture recognition is set to 1, so that the user can perform single-finger gesture interaction with the 3D model.

4. The method according to claim 3, characterized in that The step of setting the maximum finger index of the model interaction gesture recognition to 1, so as to facilitate the user to perform single-finger gesture interaction with the 3D model, includes: Set the maximum finger index of the model interactive gesture recognition to 1; After obtaining the single-finger sliding data of the user on the screen coordinate system, calculating the rotation axis of the 3D model and the finger movement distance corresponding to the single-finger sliding data in the 3D model according to the X-axis offset distance and the Y-axis offset distance in the single-finger sliding data; Calculating the rotation angle of the 3D model according to the finger movement distance; Calculating a rotation factor of the 3D model according to the rotation angle of the 3D model; Obtaining a quaternion of the single-finger sliding data in the 3D coordinate system scene according to the rotation axis, the angle, and the rotation factor; The 3D model is controlled to rotate based on the quaternion, so that the user can interact with the 3D model through a single-finger gesture.

5. The method according to claim 1, characterized in that The step of adding a model interaction gesture to the 3D model so as to facilitate gesture interaction between the user and the 3D model in the 3D rendering engine includes: Using the gesture adding method defined by the iOS system, adding a model interaction gesture of the iOS system to the 3D model; The maximum finger index for the model interaction gesture recognition is set to 2, so that the user can perform two-finger sliding interaction with the 3D model.

6. The method according to claim 5, characterized in that The step of setting the maximum finger index of the model interaction gesture recognition to 2 so as to facilitate the user to perform two-finger sliding interaction with the 3D model includes: Set the maximum finger index of the model interactive gesture recognition to 2; After obtaining the two-finger sliding data of the user on the screen coordinate system, converting the position of the 3D model from the 3D coordinate system scene to the screen coordinate system; Calculate the final position of the 3D model in the screen coordinate system as the two fingers slide according to the position of the 3D model in the screen coordinate system and the X-axis offset distance and the Y-axis offset distance in the two-finger sliding data; The final position of the 3D model in the screen coordinate system is converted to a corresponding position in the 3D coordinate system scene, so that the user can perform two-finger sliding interaction with the 3D model.

7. The method according to claim 2, characterized in that The step of adding a model interaction gesture to the 3D model so as to facilitate gesture interaction between the user and the 3D model in the 3D rendering engine includes: Using the gesture adding method defined by the iOS system, adding a model interaction gesture of the iOS system to the 3D model; The zoom size attribute of the 3D model is set equal to the product of the default zoom ratio of the model interaction gesture and the unified zoom ratio of each 3D model, so that the user can perform two-finger zoom interaction with the 3D model.

8. A custom gesture interaction device on an iOS system, characterized in that: include: Camera interaction prohibition unit, model position fixing unit and interaction gesture adding unit; The camera interaction prohibition unit is used to fix the camera of the 3D rendering engine at the origin of the 3D coordinate system scene of the iOS system to prohibit the use of the camera interaction mode in the 3D rendering engine, wherein the imaging direction of the camera is the negative direction along the z-axis; The model position fixing unit is used to fix the 3D model at a first position of a 3D coordinate system scene with the camera as the origin, so as to realize imaging of the 3D model in the 3D coordinate system scene, wherein the first position is a coordinate represented based on a SCNVector3 structure; The interactive gesture adding unit is used to add a model interactive gesture to the 3D model to facilitate the user to perform gesture interaction with the 3D model in the 3D rendering engine.

9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by the processor, the custom gesture interaction method on the iOS system is implemented as described in any one of claims 1 to 7.

10. An electronic device, characterized in that: The electronic device includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the custom gesture interaction method on the iOS system as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • System and method for controlling 3D model based on gesture

    CN106959808A

  • Gesture interaction device and method for 360-degree suspension type light field three-dimensional display system

    CN110865704A

  • Handheld mobile terminal control method and related apparatus

    CN113056718A

  • Vehicle display interaction method in iOS device based on ARKit

    CN115129156A

  • Method and system for controlling browser interface return in iOS application through gesture

    CN116820319A