Model display method, apparatus and system
The present disclosure relates to a model display method, apparatus, and system. The method includes: acquiring a hand location of a hand model in the virtual reality scene in real time, receiving an input signal from an input device, determining a key position corresponding to the input signal in the 3D model, determining model location of the 3D model in the virtual reality according to the key position in the 3D model and the hand location, and displaying the 3D model at the model location in the virtual reality scene. By this method, the 3D model of the input device in real space can be accurately displayed in the virtual reality scene.
1 . A method for projecting a three-dimensional (3D) model of an input device into a virtual reality, comprising:
in response to a hand of a user in real space activating at least one physical key in the input device, receiving at least one input signal from at least one physical key in the input device, wherein the input device comprises a keyboard or a mouse;
obtaining at least one hand location of a hand model in the virtual reality corresponding to the at least one physical key activated by the hand of the user, wherein the hand model corresponds to the hand of the user, and wherein each hand location of the at least one hand location in the virtual reality is corresponding to a position of the hand of the user in real space when activating a physical key from the at least one physical key;
for each physical key from the at least one physical key, determining, based on the at least one input signal from the physical key activated by the hand of the user, a virtual key within the 3D model of the input device that corresponds to the physical key, and obtaining a key position in the virtual reality of the virtual key within the 3D model of the input device;
determining a model location of the 3D model within the virtual reality based on the at least one hand location and the at least one key position, wherein the model location comprises a spatial position and an attitude of the 3D model;
wherein determining the model location of the 3D model within the virtual reality based on the at least one hand location and the at least one key position comprises:
in response to a number of the at least one physical key is less than three, determining the model location of the 3D model within the virtual reality based on a hand location and a key position corresponding to a physical key activated by the hand of the user; and
in response to the number of the at least one physical key is equal to or greater than three, determining the model location of the 3D model within the virtual reality based on at least three hand locations and at least three key positions in the virtual reality corresponding to at least three physical keys activated by the hand of the user; and
displaying the 3D model at the model location in a virtual reality scene to implement interaction between the input device and the virtual reality scene.
2 . The method according to claim 1 , wherein determining the model location of the 3D model within the virtual reality based on the at least one hand location and the at least one key position comprises:
obtaining the spatial position of the 3D model according to the at least one key position within the 3D model and a spatial position within the at least one hand location;
determining the attitude of the 3D model according to the at least one hand location of the hand model and the at least one key position within the 3D model corresponding to a preset amount of input signals; and
determining the model location of the 3D model in the virtual reality according to the spatial position and the attitude of the 3D model.
3 . The method according to claim 2 , wherein determining the attitude of the 3D model according to the at least one hand location of the hand model and the at least one key position within the 3D model corresponding to the preset amount of input signals comprises:
determining key spatial positions of virtual keys corresponding to the preset amount of input signals according to spatial positions in the at least one hand location;
determining a spatial position of a plane in which the 3D model resides and an orientation of the 3D model according to the preset amount of hand locations and key positions of the preset amount of virtual keys in the 3D model; and
determining the attitude of the 3D model according to the spatial position of the plane and the orientation of the 3D model.
4 . The method according to claim 3 , wherein determining the spatial position of the plane in which the 3D model resides and the orientation of the 3D model comprises:
in response to determining that the preset amount is a first number:
determining the spatial position of the plane in which the 3D model resides according to the spatial positions in the preset amount of hand locations of the hand model; and
determining the orientation of the 3D model according to an orientation of a polygon formed by the first number of virtual keys, a spatial position and a position in the 3D model of each virtual key in the polygon.
5 . The method according to claim 3 , wherein determining the spatial position of the plane in which the 3D model resides and the orientation of the 3D model comprises:
in response to determining that the preset amount is a second number:
determining a target part for pressing the preset amount of virtual keys in the hand model;
determining a spatial position of the plane in which the target part resides and an orientation of the target part according to the attitude in the at least one hand location of the hand model;
calculating and determining the spatial position of the plane in which the 3D model resides based on the spatial position of the plane in which the target part resides; and
determining an orientation of each virtual key in the second number of virtual keys according to the orientation of the target part; and determining the orientation of the 3D model based on the orientation of each virtual key and a position of each virtual key in the 3D model in the second number of virtual keys.
6 . The method according to claim 1 , wherein after the 3D model is displayed at the model location in the virtual reality scene, the method further comprises:
receiving the input signal from the input device to get an updated input signal;
acquiring an updated hand location; and
updating the 3D model in the virtual reality scene according to the updated input signal and the updated hand location.
7 . The method according to claim 1 , further comprising, after displaying the 3D model at the model location and in response to receiving a second input signal from the input device, displaying a manipulation effect of the virtual key corresponding to the second input signal in the 3D model.
8 . An electronic apparatus, comprising:
one or more processors;
a memory coupled to the one or more processors;
a display device that is configured to display a virtual reality scene; and
a plurality of programs for projecting a virtual reality (VR) model stored in the memory that, when executed by the one or more processors, cause the electronic apparatus to perform the plurality of operations comprising:
in response to a hand of a user in real space activating at least one physical key in the input device, receiving at least one input signal from at least one physical key in an input device, wherein the input device comprises a keyboard or a mouse;
obtaining at least one hand location of a hand model in the virtual reality corresponding to the at least one physical key activated by the hand of the user, wherein the hand model corresponds to the hand of the user, and wherein each hand location of the at least one hand location in the virtual reality is corresponding to a position of the hand of the user in real space when activating a physical key from the at least one physical key;
for each physical key from the at least one physical key, determining, based on the at least one input signal from the physical key activated by the hand of the user, a virtual key within a three-dimensional (3D) model of the input device that corresponds to the physical key, and obtaining a key position in the virtual reality of the virtual key within a three-dimensional (3D) model of the input device;
determining a model location of the 3D model within the virtual reality based on the at least one hand location and the at least one key position, wherein the model location comprises a spatial position and an attitude of the 3D model;
wherein determining the model location of the 3D model within the virtual reality based on the at least one hand location and the at least one key position comprises:
in response to a number of the at least one physical key is less than three, determining the model location of the 3D model within the virtual reality based on a hand location and a key position corresponding to a physical key activated by the hand of the user; and
in response to the number of the at least one physical key is equal to or greater than three, determining the model location of the 3D model within the virtual reality based on at least three hand locations and at least three key positions in the virtual reality corresponding to at least three physical keys activated by the hand of the user; and
displaying the 3D model at the model location in a virtual reality scene to implement interaction between the input device and the virtual reality scene.
9 . The electronic apparatus according to claim 8 , wherein determining the model location of the 3D model within the virtual reality based on the at least one hand location and the at least one key position comprises:
determining the spatial position of the 3D model according to the at least one key position within the 3D model and a spatial position in the at least one hand location;
determining the attitude of the 3D model according to the at least one hand location of the hand model and the at least one key position corresponding to a preset amount of input signals within the 3D model; and
determining the model location of the 3D model in the virtual reality according to the spatial position and the attitude of the 3D model.
10 . The electronic apparatus according to claim 9 , wherein determining the attitude of the 3D model according to the at least one hand location of the hand model and the at least one key position within the 3D model corresponding to the preset amount of input signals comprises:
determining key spatial positions of virtual keys corresponding to the preset amount of input signals according to spatial positions in the at least one hand location;
determining a spatial position of the plane in which the 3D model resides and an orientation of the 3D model according to the preset amount of hand locations and key positions of the preset amount of virtual keys in the 3D model; and
determining the attitude of the 3D model according to the spatial position of the plane and the orientation of the 3D model.
11 . The electronic apparatus according to claim 10 , wherein determining the spatial position of the plane in which the 3D model resides and the orientation of the 3D model comprises:
in response to determining that the preset amount is a first number:
determining the spatial position of the plane in which the 3D model resides according to the spatial positions in the preset amount of hand locations of the hand model; and
determining the orientation of the 3D model according to an orientation of a polygon formed by the first number of virtual keys, a spatial position and a position in the 3D model of each virtual key in the polygon.
12 . The electronic apparatus according to claim 10 , wherein determining the spatial position of the plane in which the 3D model resides and the orientation of the 3D model comprises:
in response to determining that the preset amount is a second number:
determining a target part for pressing the preset amount of virtual keys in the hand model;
determining a spatial position of the plane in which the target part resides and an orientation of the target part according to the attitude in the at least one hand location of the hand model;
calculating and determining the spatial position of the plane in which the 3D model resides based on the spatial position of the plane in which the target part resides; and
determining an orientation of each virtual key in the second number of virtual keys according to the orientation of the target part; and determining the orientation of the 3D model based on the orientation of each virtual key and a position of each virtual key in the 3D model in the second number of virtual keys.
13 . The electronic apparatus according to claim 8 , wherein after the 3D model is displayed at the model location in the virtual reality scene, the plurality of operations further comprises:
receiving the input signal from the input device to get an updated input signal;
acquiring an updated hand location; and
updating the 3D model in the virtual reality scene according to the updated input signal and the updated hand location.
14 . The electronic apparatus according to claim 8 , wherein the plurality of programs for projecting a virtual reality (VR) model stored in the memory that, when executed by the one or more processors, further cause the electronic apparatus to perform the operations comprising, after displaying the 3D model at the model location and in response to receiving a second input signal from the input device, displaying a manipulation effect of the virtual key corresponding to the second input signal in the 3D model.
15 . A non-transitory computer readable storage medium storing a plurality of programs for execution by an electronic device having one or more processors, wherein the plurality of programs, when executed by the one or more processors, cause the electronic device to perform acts comprising:
in response to a hand of a user in real space activating at least one physical key in the input device, receiving at least one input signal from at least one physical key in an input device, wherein the input device comprises a keyboard or a mouse;
obtaining at least one hand location of a hand model in the virtual reality corresponding to the at least one physical key activated by the hand of the user, wherein the hand model corresponds to the hand of the user, and wherein each hand location of the at least one hand location in the virtual reality is corresponding to a position of the hand of the user in real space when activating a physical key from the at least one physical key;
for each physical key from the at least one physical key, determining, based on the at least one input signal from the physical key activated by the hand of the user, a virtual key within a three-dimensional (3D) model of the input device that corresponds to the physical key, and obtaining a key position in the virtual reality of the virtual key within the 3D model of the input device;
determining a model location of the 3D model within the virtual reality based on the at least one hand location and the at least one key position, wherein the model location comprises a spatial position and an attitude of the 3D model;
wherein determining the model location of the 3D model within the virtual reality based on the at least one hand location and the at least one key position comprises:
in response to a number of the at least one physical key is less than three, determining the model location of the 3D model within the virtual reality based on a hand location and a key position corresponding to a physical key activated by the hand of the user; and
in response to the number of the at least one physical key is equal to or greater than three, determining the model location of the 3D model within the virtual reality based on at least three hand locations and at least three key positions in the virtual reality corresponding to at least three physical keys activated by the hand of the user; and
displaying the 3D model at the model location in a virtual reality scene to implement interaction between the input device and the virtual reality scene.
16 . The non-transitory computer readable storage medium according to claim 15 , wherein determining the model location of the 3D model within the virtual reality based on the at least one hand location and the at least one key position comprises:
determining the spatial position of the 3D model according to the at least one key position within the 3D model and a spatial position in the at least one hand location;
determining the attitude of the 3D model according to the at least one hand location of the hand model and the at least one key position corresponding to a preset amount of input signals; and
determining the model location of the 3D model in the virtual reality according to the spatial position and the attitude of the 3D model.
17 . The non-transitory computer readable storage medium according to claim 16 , wherein determining the attitude of the 3D model according to the at least one hand location of the hand model and the at least one key position within the 3D model corresponding to the preset amount of input signals comprises:
determining key spatial positions of virtual keys corresponding to the preset amount of input signals according to spatial positions in the at least one hand location;
determining a spatial position of the plane in which the 3D model resides and an orientation of the 3D model according to the preset amount of hand locations and key positions of the preset amount of virtual keys in the 3D model; and
determining the attitude of the 3D model according to the spatial position of the plane and the orientation of the 3D model.
18 . The non-transitory computer readable storage medium according to claim 17 , wherein determining the spatial position of the plane in which the 3D model resides and the orientation of the 3D model comprises:
in response to determining that the preset amount is a first number:
determining the spatial position of the plane in which the 3D model resides according to the spatial positions in the preset amount of hand locations of the hand model; and
determining the orientation of the 3D model according to an orientation of a polygon formed by the first number of virtual keys, a spatial position and a position in the 3D model of each virtual key in the polygon.
19 . The non-transitory computer readable storage medium according to claim 17 , wherein determining the spatial position of the plane in which the 3D model resides and the orientation of the 3D model comprises:
in response to determining that the preset amount is a second number:
determining a target part for pressing the preset amount of virtual keys in the hand model;
determining a spatial position of the plane in which the target part resides and an orientation of the target part according to the attitude in the at least one hand location of the hand model;
calculating and determining the spatial position of the plane in which the 3D model resides based on the spatial position of the plane in which the target part resides; and
determining an orientation of each virtual key in the second number of virtual keys according to the orientation of the target part; and determining the orientation of the 3D model based on the orientation of each virtual key and a position of each virtual key in the 3D model in the second number of virtual keys.
20 . The non-transitory computer readable storage medium according to claim 15 , wherein after the 3D model is displayed at the model location in the virtual reality scene, the electronic apparatus is caused to perform acts further comprising:
receiving the input signal from the input device to get an updated input signal;
acquiring an updated hand location; and
updating the 3D model in the virtual reality scene according to the updated input signal and the updated hand location.
21 . The non-transitory computer readable storage medium according to claim 15 , wherein the plurality of programs, when executed by the one or more processors, further cause the electronic device to perform acts comprising, after displaying the 3D model at the model location and in response to receiving a second input signal from the input device, displaying a manipulation effect of the virtual key corresponding to the second input signal in the 3D model.