Three-dimensional interface control method and terminal
Embodiments of this disclosure disclose an interface control method, and relate to the field of virtual reality technologies, and are applied to a virtual reality device, an augmented reality device, a mixed reality device, or the like. The method in embodiments of this disclosure includes: dividing, based on a user operation, an interface that includes dividable components and that is displayed in a virtual environment, and separately displaying and controlling subinterfaces obtained through division. Based on the interface control method, a user may divide the interface including the dividable components based on a user requirement, so that interface display flexibility and user experience are improved.
1 . An interface control method, comprising:
obtaining, by a terminal, a first operation on a first interface displayed in a virtual environment, wherein the first interface comprises at least two dividable components;
displaying, by the terminal in the virtual environment based on division location information in response to the first operation, a first subinterface and a second subinterface that are obtained by dividing the first interface, wherein the first subinterface comprises a first dividable component of the at least two dividable components, the second subinterface comprises a second dividable component adjacent to the first dividable component, and the division location information comprises a boundary between the first dividable component and the second dividable component;
obtaining, by the terminal, a second operation on a second interface displayed in the virtual environment, wherein the second interface comprises at least two dividable components, wherein the first interface is an interface of a first application, and the second interface is an interface of a second application different from the first application;
displaying, by the terminal in the virtual environment based on second division location information in response to the second operation, a third subinterface and a fourth subinterface that are obtained by dividing the second interface, wherein the third subinterface comprises a first dividable component of the at least two dividable components of the second interface, the fourth subinterface comprises a second dividable component adjacent to the first dividable component of the second interface, and the second division location information comprises a boundary between the third dividable component and the fourth dividable component;
moving, by the terminal, the first subinterface toward the third subinterface; and
when a distance between the first subinterface and the third subinterface becomes equal to or less than a first threshold as the first subinterface approaches the third subinterface and without contacting the third subinterface, wherein the first threshold is a positive value greater than 0, displaying, by the terminal in the virtual environment, a fifth subinterface obtained by combining the first subinterface and the third subinterface, wherein the first subinterface comprises a first icon for controlling a first function of the first application, the third subinterface comprises a second icon for controlling a second function of the second application; and
the fifth subinterface comprises a third icon, and the third icon is used to control the first function of the first application and the second function of the second application, wherein the first function is the same as the second function.
2 . The method according to claim 1 , wherein the first operation comprises first voice information obtained by the terminal using a voice collection apparatus, and wherein the fifth subinterface is controlled based on second voice information obtained by the terminal using the voice collection apparatus.
3 . The method according to claim 1 , wherein the first operation comprises a first gesture obtained by the terminal using a sensor system, and wherein the first gesture comprises: moving a flat palm with fingers together by a preset distance in a first direction in which a palm plane extends, wherein the first direction in which the palm plane extends is parallel to the boundary.
4 . The method according to claim 1 , wherein the method further comprises:
displaying, by the terminal, a division line on the boundary between the first dividable component and the second dividable component.
5 . The method according to claim 1 , wherein
displaying, by the terminal in the virtual environment based on division location information in response to the first operation, the first subinterface and the second subinterface that are obtained by dividing the first interface comprises:
displaying, by the terminal, the first subinterface in a first location, and displaying the second subinterface in a second location, wherein the first location is the same as a first initial location, a distance between the second location and a second initial location in a direction away from the first initial location is a first preset value, the first initial location is a location of the first subinterface on the first interface when the terminal obtains a first instruction, and the second initial location is a location of the second subinterface on the first interface when the terminal obtains the first instruction; or
the second location is the same as a second initial location, and a distance between the first location and a first initial location in a direction away from the second initial location is a second preset value; or
a distance between the first location and a first initial location in a direction away from a second initial location is a third preset value, and a distance between the second location and the second initial location in a direction away from the first initial location is a fourth preset value.
6 . The method according to claim 1 , wherein the method further comprises:
moving, by the terminal, the first subinterface in response to a third operation on the first subinterface.
7 . The method according to claim 6 , wherein the third operation comprises: a pinch grip gesture pointing to the first subinterface, wherein the pinch grip gesture comprises a hand state in which a thumb approaches at least one of four fingers, and keeping the pinch grip gesture and moving; or
touching and holding the first subinterface and moving; or
keeping an open palm gesture and moving, wherein the open palm gesture comprises a hand state with fingers together and a palm up.
8 . The method according to claim 1 , wherein the first subinterface is an input interface of the first application, the second subinterface is an output interface of the first application, the third subinterface is an input interface of the second application, the fourth subinterface is an output interface of the second application, and the method further comprises:
displaying, by the terminal, an indication identifier on an edge of the fifth subinterface, wherein the indication identifier is used to determine an application currently controlled by the fifth subinterface;
based on the indication identifier pointing to the second subinterface, controlling, by the terminal, the first application based on an input operation performed on the fifth subinterface; and
based on the indication identifier pointing to the fourth subinterface, controlling, by the terminal, the second application based on an input operation performed on the fifth subinterface.
9 . A terminal, comprising one or more processors and a memory, wherein the memory stores computer-readable instructions; and
upon the one or more processors reading the computer-readable instructions, the terminal is enabled to implement:
obtaining, by the terminal, a first operation on a first interface displayed in a virtual environment, wherein the first interface comprises at least two dividable components;
displaying, by the terminal in the virtual environment based on division location information in response to the first operation, a first subinterface and a second subinterface that are obtained by dividing the first interface, wherein the first subinterface comprises a first dividable component of the at least two dividable components, the second subinterface comprises a second dividable component adjacent to the first dividable component, and the division location information comprises a boundary between the first dividable component and the second dividable component;
obtaining, by the terminal, a second operation on a second interface displayed in the virtual environment, wherein the second interface comprises at least two dividable components, wherein the first interface is an interface of a first application, and the second interface is an interface of a second application different from the first application;
displaying, by the terminal in the virtual environment based on second division location information in response to the second operation, a third subinterface and a fourth subinterface that are obtained by dividing the second interface, wherein the third subinterface comprises a first dividable component of the at least two dividable components of the second interface, the fourth subinterface comprises a second dividable component adjacent to the first dividable component of the second interface, and the second division location information comprises a boundary between the third dividable component and the fourth dividable component;
moving, by the terminal, the first subinterface toward the third subinterface; and
when a distance between the first subinterface and the third subinterface becomes equal to or less than a first threshold as the first subinterface approaches the third subinterface and without contacting the third subinterface, wherein the first threshold is a positive value greater than 0, displaying, by the terminal in the virtual environment, a fifth subinterface obtained by combining the first subinterface and the third subinterface, wherein the first subinterface comprises a first icon for controlling a first function of the first application, the third subinterface comprises a second icon for controlling a second function of the second application; and
the fifth subinterface comprises a third icon, and the third icon is used to control the first function of the first application and the second function of the second application, wherein the first function is the same as the second function.
10 . The terminal according to claim 9 , wherein the first operation comprises first voice information obtained by the terminal using a voice collection apparatus, and wherein the fifth subinterface is controlled based on second voice information obtained by the terminal using the voice collection apparatus.
11 . The terminal according to claim 9 , wherein the first operation comprises a first gesture obtained by the terminal using a sensor system, and wherein the first gesture comprises: moving a flat palm with fingers together by a preset distance in a first direction in which a palm plane extends, wherein the first direction in which the palm plane extends is parallel to the boundary.
12 . The method according to claim 9 , wherein the terminal is further enabled to implement:
displaying, by the terminal, a division line on the boundary between the first dividable component and the second dividable component.
13 . The terminal according to claim 9 , wherein displaying, by the terminal in the virtual environment based on division location information in response to the first operation, the first subinterface and the second subinterface that are obtained by dividing the first interface specifically comprises:
displaying, by the terminal, the first subinterface in a first location, and displaying the second subinterface in a second location, wherein
the first location is the same as a first initial location, a distance between the second location and a second initial location in a direction away from the first initial location is a first preset value, the first initial location is a location of the first subinterface on the first interface when the terminal obtains a first instruction, and the second initial location is a location of the second subinterface on the first interface when the terminal obtains the first instruction; or
the second location is the same as a second initial location, and a distance between the first location and a first initial location in a direction away from the second initial location is a second preset value; or
a distance between the first location and a first initial location in a direction away from a second initial location is a third preset value, and a distance between the second location and the second initial location in a direction away from the first initial location is a fourth preset value.
14 . The terminal according to claim 9 , wherein the terminal is further enabled to implement:
moving, by the terminal, the first subinterface in response to a third operation on the first subinterface.
15 . The terminal according to claim 14 , wherein the third operation comprises: a pinch grip gesture pointing to the first subinterface, wherein the pinch grip gesture comprises a hand state in which a thumb approaches at least one of four fingers, and keeping the pinch grip gesture and moving; or
touching and holding the first subinterface and moving; or
keeping an open palm gesture and moving, wherein the open palm gesture comprises a hand state with fingers together and a palm up.
16 . The terminal according to claim 9 , wherein the first subinterface is an input interface of the first application, the second subinterface is an output interface of the first application, the third subinterface is an input interface of the second application, the fourth subinterface is an output interface of the second application, and wherein the terminal is further enabled to implement:
displaying, by the terminal, an indication identifier on an edge of the fifth subinterface, wherein the indication identifier is used to determine an application currently controlled by the fifth subinterface;
based on the indication identifier pointing to the second subinterface, controlling, by the terminal, the first application based on an input operation performed on the fifth subinterface; and
based on the indication identifier pointing to the fourth subinterface, controlling, by the terminal, the second application based on an input operation performed on the fifth subinterface.