Gestures to enable menus using augmented reality content in a messaging system
The subject technology detects a first location and a first position of a first representation of a first finger and a second location and a second position of a second representation of a second finger. The subject technology detects a first particular location and a first particular position of a first particular representation of a first particular finger and a second particular location and a second particular position of a second particular representation of a second particular finger. The subject technology detects a first change in the first location and the first position and a second change in the second location and the second position. The subject technology detects a first particular change in the first particular location and the first particular position and a second particular change in the second particular location and the second particular position. The subject technology generates a set of virtual objects.
1 . A method, comprising:
detecting, using one or more hardware processors, from a set of frames, a first gesture and a second gesture, the first gesture corresponding to a first pinch gesture and the second gesture corresponding to a second pinch gesture, the first pinch gesture and the second pinch gesture corresponding to different hands, the first pinch gesture comprising two different fingers of a first hand touching, and the second pinch gesture comprising two different of a second hand touching, the first pinch gesture and the second pinch gesture being detected in at least one same frame from the set of frames;
detecting, using the one or more hardware processors, a first location and a first position of a first representation of a first finger from the first gesture and a second location and a second position of a second representation of a second finger from the first gesture;
detecting, using the one or more hardware processors, a first particular location and a first particular position of a first particular representation of a first particular finger from the second gesture and a second particular location and a second particular position of a second particular representation of a second particular finger from the second gesture;
detecting, using the one or more hardware processors, a first change in the first location and the first position and a second change in the second location and the second position;
detecting, using the one or more hardware processors, a first particular change in the first particular location and the first particular position and a second particular change in the second particular location and the second particular position;
in response to the first change, second change, first particular change, and second particular change, generating, using the one or more hardware processors, a set of virtual objects along a line from the first location and the first position to the first particular location and the first particular position, wherein a first distance between the first change and the first particular change is greater than a threshold distance value, and a second distance between the second change and the second particular change are greater than the threshold distance value;
detecting, from a different set of frames, a first collision event corresponding to a first collider of the first representation of the first finger intersecting with a second collider of a first virtual object from the generated set of virtual objects;
in response to the first collision event, selecting the first virtual object and generating augmented reality content associated with the selected first virtual object;
detecting, from a second different set frames, a third gesture and a fourth gesture, the third gesture corresponding to a third pinch gesture and the fourth gesture corresponding to a fourth pinch gesture, the third pinch gesture and the fourth pinch gesture corresponding to different hands;
in response to detecting the third gesture and the fourth gesture, moving the set of virtual objects to be arranged in a second line based on spatial positions of the third pinch gesture and the fourth pinch gesture, wherein the second line is different from the line;
rendering, using the one or more hardware processors, the set of virtual objects within a first scene; and
providing for display, using the one or more hardware processors, the rendered set of virtual objects within the first scene.
2 . The method of claim 1 , wherein the first change and the second change does not result in an in increase in a distance greater than a first threshold value between the first representation of the first finger and the second representation of the second finger, and the first finger and the second finger is from a same first hand, and
wherein the first particular change and the second particular change does not result in an in increase in a distance greater than a first particular threshold value between the first particular representation of the first particular finger and the second particular representation of the second particular finger, and the first particular finger and the second particular finger is from a same second hand.
3 . The method of claim 1 , further comprising:
detecting, from a second set of frames, a third location and a third position of the first representation of the first finger and a fourth location and a fourth position of the second representation of the second finger;
detecting a third change in the third location and the third position and a fourth change in the fourth location and the fourth position, wherein the third change and the fourth change result in an increase in a distance greater than a threshold value between the first representation of the first finger and the second representation of the second finger, and the first finger and the second finger is from a same hand;
detecting, from the second set of frames, a third particular location and a third particular position of the first particular representation of the first particular finger and a fourth particular location and a fourth particular position of the second particular representation of the second particular finger;
detecting a third particular change in the third particular location and the third particular position and a fourth particular change in the fourth particular location and the fourth particular position, wherein the third particular change and the fourth particular change result in an increase in a distance greater than a particular threshold value between the first particular representation of the first particular finger and the second particular representation of the second particular finger, and the first particular finger and the second particular finger is from a same second hand; and
in response to detecting the third change, the fourth change, the third particular change, and the fourth particular change, ceasing generating the set of virtual objects along the line from the first location and the first position to the first particular location and the first particular position.
4 . The method of claim 1 , wherein the rendered set of objects is provided for display within a messaging application executing on a client device.
5 . The method of claim 3 , further comprising:
performing an operation in connection with the selection, the operation comprising generating augmented reality content associated with the selected first virtual object for display within the first scene.
6 . The method of claim 3 , further comprising:
detecting a third location and a third position of the first representation of the first finger from the third gesture and a fourth location and a fourth position of the second representation of the second finger from the third gesture;
detecting a third particular location and a third particular position of the first particular representation of the first particular finger from the fourth gesture and a fourth particular location and a fourth particular position of the second particular representation of the second particular finger from the fourth gesture;
detecting a third change in the third location and the third position and a fourth change in the fourth location and the fourth position;
detecting a third particular change in the third particular location and the third particular position and a fourth particular change in the fourth particular location and the fourth particular position;
in response to the third change, fourth change, third particular change, and fourth particular change, moving the set of virtual objects to be arranged in a second line from the third location and the third position to the third particular location and the third particular position, wherein a third distance between the third change and the third particular change is greater than a particular threshold distance value, and a fourth distance between the fourth change and the fourth particular change are greater than the particular threshold distance value;
rendering the moved set of virtual objects within the first scene; and
providing for display the rendered moved set of virtual objects within the first scene.
7 . The method of claim 3 , further comprising:
detecting, from a fifth set of frames, a third gesture and a fourth gesture, the third gesture corresponding to a third pinch gesture and the fourth gesture corresponding to a fourth pinch gesture, the third pinch gesture and the fourth pinch gesture corresponding to different hands;
detecting a third location and a third position of the first representation of the first finger from the third gesture and a fourth location and a fourth position of the second representation of the second finger from the third gesture;
detecting a third particular location and a third particular position of the first particular representation of the first particular finger from the fourth gesture and a fourth particular location and a fourth particular position of the second particular representation of the second particular finger from the fourth gesture;
detecting a third change in the third location and the third position and a fourth change in the fourth location and the fourth position;
detecting a third particular change in the third particular location and the third particular position and a fourth particular change in the fourth particular location and the fourth particular position;
in response to the third change, fourth change, third particular change, and fourth particular change, moving the set of virtual objects to be overlaid on each other such that only a single virtual object is visible within the first scene, wherein a third distance between the third change and the third particular change is less than a particular threshold distance value, and a fourth distance between the fourth change and the fourth particular change are less than the particular threshold distance value;
rendering the moved set of virtual objects within the first scene; and
providing for display the rendered moved set of virtual objects within the first scene.
8 . The method of claim 6 , wherein the rendered moved set of virtual objects are arranged in a vertical manner.
9 . The method of claim 6 , wherein moving the set of virtual objects to be arranged in the second line comprises:
removing a first set of virtual objects from set of virtual objects to provide a second set of objects, the removing based at least in part on a length of the second line such that the second set of objects are arranged to fit along the second line without overlapping each other and the set of virtual objects are unable to fit along the second line without at least one virtual object being overlaid with a second virtual object; and
moving the second set of objects to be arranged in the second line.
10 . The method of claim 9 , wherein moving the set of virtual objects to be overlaid on each other such that only a single virtual object is visible within the first scene comprises:
removing a first set of virtual objects from set of virtual objects to provide the single virtual object.
11 . A system comprising:
a processor; and
a memory including instructions that, when executed by the processor, cause the processor to perform operations comprising:
detecting, from a set of frames, a first gesture and a second gesture, the first gesture corresponding to a first pinch gesture and the second gesture corresponding to a second pinch gesture, the first pinch gesture and the second pinch gesture corresponding to different hands, the first pinch gesture comprising two different fingers of a first hand touching, and the second pinch gesture comprising two different of a second hand touching, the first pinch gesture and the second pinch gesture being detected in at least one same frame from the set of frames;
detecting a first location and a first position of a first representation of a first finger from the first gesture and a second location and a second position of a second representation of a second finger from the first gesture;
detecting a first particular location and a first particular position of a first particular representation of a first particular finger from the second gesture and a second particular location and a second particular position of a second particular representation of a second particular finger from the second gesture;
detecting a first change in the first location and the first position and a second change in the second location and the second position;
detecting a first particular change in the first particular location and the first particular position and a second particular change in the second particular location and the second particular position;
in response to the first change, second change, first particular change, and second particular change, generating a set of virtual objects along a line from the first location and the first position to the first particular location and the first particular position, wherein a first distance between the first change and the first particular change is greater than a threshold distance value, and a second distance between the second change and the second particular change are greater than the threshold distance value;
detecting, from a different set of frames, a first collision event corresponding to a first collider of the first representation of the first finger intersecting with a second collider of a first virtual object from the generated set of virtual objects;
in response to the first collision event, selecting the first virtual object and generating augmented reality content associated with the selected first virtual object;
detecting, from a second different set frames, a third gesture and a fourth gesture, the third gesture corresponding to a third pinch gesture and the fourth gesture corresponding to a fourth pinch gesture, the third pinch gesture and the fourth pinch gesture corresponding to different hands;
in response to detecting the third gesture and the fourth gesture, moving the set of virtual objects to be arranged in a second line based on spatial positions of the third pinch gesture and the fourth pinch gesture, wherein the second line is different from the line;
rendering the set of virtual objects within a first scene; and
providing for display the rendered set of virtual objects within the first scene.
12 . The system of claim 11 , wherein the first change and the second change does not result in an in increase in a distance greater than a first threshold value between the first representation of the first finger and the second representation of the second finger, and the first finger and the second finger is from a same first hand, and
wherein the first particular change and the second particular change does not result in an in increase in a distance greater than a first particular threshold value between the first particular representation of the first particular finger and the second particular representation of the second particular finger, and the first particular finger and the second particular finger is from a same second hand.
13 . The system of claim 11 , wherein the operations further comprise:
detecting, from a second set of frames, a third location and a third position of the first representation of the first finger and a fourth location and a fourth position of the second representation of the second finger;
detecting a third change in the third location and the third position and a fourth change in the fourth location and the fourth position, wherein the third change and the fourth change result in an increase in a distance greater than a threshold value between the first representation of the first finger and the second representation of the second finger, and the first finger and the second finger is from a same hand;
detecting, from the second set of frames, a third particular location and a third particular position of the first particular representation of the first particular finger and a fourth particular location and a fourth particular position of the second particular representation of the second particular finger;
detecting a third particular change in the third particular location and the third particular position and a fourth particular change in the fourth particular location and the fourth particular position, wherein the third particular change and the fourth particular change result in an increase in a distance greater than a particular threshold value between the first particular representation of the first particular finger and the second particular representation of the second particular finger, and the first particular finger and the second particular finger is from a same second hand; and
in response to detecting the third change, the fourth change, the third particular change, and the fourth particular change, ceasing generating the set of virtual objects along the line from the first location and the first position to the first particular location and the first particular position.
14 . The system of claim 13 , wherein the operations further comprise:
performing an operation in connection with the selection, the operation comprising generating augmented reality content associated with the selected first virtual object for display within the first scene.
15 . The system of claim 13 , wherein the operations further comprise:
detecting a third location and a third position of the first representation of the first finger from the third gesture and a fourth location and a fourth position of the second representation of the second finger from the third gesture;
detecting a third particular location and a third particular position of the first particular representation of the first particular finger from the fourth gesture and a fourth particular location and a fourth particular position of the second particular representation of the second particular finger from the fourth gesture;
detecting a third change in the third location and the third position and a fourth change in the fourth location and the fourth position;
detecting a third particular change in the third particular location and the third particular position and a fourth particular change in the fourth particular location and the fourth particular position;
in response to the third change, fourth change, third particular change, and fourth particular change, moving the set of virtual objects to be arranged in a second line from the third location and the third position to the third particular location and the third particular position, wherein a third distance between the third change and the third particular change is greater than a particular threshold distance value, and a fourth distance between the fourth change and the fourth particular change are greater than the particular threshold distance value;
rendering the moved set of virtual objects within the first scene; and
providing for display the rendered moved set of virtual objects within the first scene.
16 . The system of claim 13 , wherein the operations further comprise:
detecting, from a fifth set of frames, a third gesture and a fourth gesture, the third gesture corresponding to a third pinch gesture and the fourth gesture corresponding to a fourth pinch gesture, the third pinch gesture and the fourth pinch gesture corresponding to different hands;
detecting a third location and a third position of the first representation of the first finger from the third gesture and a fourth location and a fourth position of the second representation of the second finger from the third gesture;
detecting a third particular location and a third particular position of the first particular representation of the first particular finger from the fourth gesture and a fourth particular location and a fourth particular position of the second particular representation of the second particular finger from the fourth gesture;
detecting a third change in the third location and the third position and a fourth change in the fourth location and the fourth position;
detecting a third particular change in the third particular location and the third particular position and a fourth particular change in the fourth particular location and the fourth particular position;
in response to the third change, fourth change, third particular change, and fourth particular change, moving the set of virtual objects to be overlaid on each other such that only a single virtual object is visible within the first scene, wherein a third distance between the third change and the third particular change is less than a particular threshold distance value, and a fourth distance between the fourth change and the fourth particular change are less than the particular threshold distance value;
rendering the moved set of virtual objects within the first scene; and
providing for display the rendered moved set of virtual objects within the first scene.
17 . The system of claim 15 , wherein the rendered moved set of virtual objects are arranged in a vertical manner.
18 . The system of claim 15 , wherein moving the set of virtual objects to be arranged in the second line comprises:
removing a first set of virtual objects from set of virtual objects to provide a second set of objects, the removing based at least in part on a length of the second line such that the second set of objects are arranged to fit along the second line without overlapping each other and the set of virtual objects are unable to fit along the second line without at least one virtual object being overlaid with a second virtual object; and
moving the second set of objects to be arranged in the second line.
19 . The system of claim 18 , wherein moving the set of virtual objects to be overlaid on each other such that only a single virtual object is visible within the first scene comprises:
removing a first set of virtual objects from set of virtual objects to provide the single virtual object.
20 . A non-transitory computer-readable medium comprising instructions, which when executed by a computing device, cause the computing device to perform operations comprising:
detecting, from a set of frames, a first gesture and a second gesture, the first gesture corresponding to a first pinch gesture and the second gesture corresponding to a second pinch gesture, the first pinch gesture and the second pinch gesture corresponding to different hands, the first pinch gesture comprising two different fingers of a first hand touching, and the second pinch gesture comprising two different of a second hand touching, the first pinch gesture and the second pinch gesture being detected in at least one same frame from the set of frames;
detecting a first location and a first position of a first representation of a first finger from the first gesture and a second location and a second position of a second representation of a second finger from the first gesture;
detecting a first particular location and a first particular position of a first particular representation of a first particular finger from the second gesture and a second particular location and a second particular position of a second particular representation of a second particular finger from the second gesture;
detecting a first change in the first location and the first position and a second change in the second location and the second position;
detecting a first particular change in the first particular location and the first particular position and a second particular change in the second particular location and the second particular position;
in response to the first change, second change, first particular change, and second particular change, generating a set of virtual objects along a line from the first location and the first position to the first particular location and the first particular position, wherein a first distance between the first change and the first particular change is greater than a threshold distance value, and a second distance between the second change and the second particular change are greater than the threshold distance value;
detecting, from a different set of frames, a first collision event corresponding to a first collider of the first representation of the first finger intersecting with a second collider of a first virtual object from the generated set of virtual objects;
in response to the first collision event, selecting the first virtual object and generating augmented reality content associated with the selected first virtual object;
detecting, from a second different set frames, a third gesture and a fourth gesture, the third gesture corresponding to a third pinch gesture and the fourth gesture corresponding to a fourth pinch gesture, the third pinch gesture and the fourth pinch gesture corresponding to different hands;
in response to detecting the third gesture and the fourth gesture, moving the set of virtual objects to be arranged in a second line based on spatial positions of the third pinch gesture and the fourth pinch gesture, wherein the second line is different from the line;
rendering the set of virtual objects within a first scene; and
providing for display the rendered set of virtual objects within the first scene.