How to Move or rotate 2D, 3D image in hand recognition without scaling the size?
Dear All,
I used the hand template to add a 2D and 3D photo onto the hand.
However, how can I move the position of the 2D and 3D photo when user drag their finger to a position?
Also, is it possible for user to rotate the image slightly (e.g. 10 degree) using some command? e.g. two finger rotating.
Something similar to this link, but I fail to make it work on 2D and 3D hand template.
Thank you so much.
2. Second question is, is it able to detect when I flip my hand?
So. I can showcase an image when my hand in facing front, and show another image when hand is facing back.
Hey Vincent,
At this time there are no function call backs for like pinching or some other hand commands. You can only get the position and scale and also rotation of the bounding box of the hand and then attach an image to it.
The only call back is available right now if onObjectFound or onObjectLost. As you can see in the Hand Template we used those callbacks to animate the Hand model on the forehead.
For your second question the answer is no. At this time back and front of the hand detected as a hand and theres no way to change the image based on the hand facing.
Hope you find this helpful.
Best,
Amir.
Dear Amir,
As in the hand template, there is a place to modify the Offset X, Offset Y and Rotate.
I want to modify this three values. E.g. for something simple, can I make a button, whenever the button is tapped, then the value of Offset X increase 0.1?
If the above is possible, can we make it more advance as the following script? When the user tap and drag the image, the lens detects the user finger position, and update the Offset X as the new position.
Thank you so much.
Source: https://support.lensstudio.com/hc/en-us/community/posts/115020451423-How-to-make-a-draggable-billboard-object-?page=1#community_comment_115005538003
Hey Vincent,
I created a project file for you that is show you how to create a simple touch controller for hand template.
Swiping left or right will scale down and scale up the Image component and swiping up and down will rotate the Image.
When you open the template take look at TouchController.js. I commented out everything and should be easy to understand.
https://storage.googleapis.com/snapchat-lens-assets/f1a09194-f02d-43ed-92b8-62e843179ff0/lensStudio/Forum-Helpers/touch_control_example.zip
Hope this will help you.
Best,
Amir.
Dear Amir,
Thank you for your project file. It is a great help to me!
I am looking for an improvement. Is it possible for the object to move to the exact position on user's finger touching position? Same as the below source.
https://support.lensstudio.com/hc/en-us/community/posts/115020451423-How-to-make-a-draggable-billboard-object-?page=1#community_comment_115005538003
Since right now, it is hard for users to control the position of object.
Second, I am thinking a better way for user to rotate an object.
is it possible to detect a two finger touching and moving clockwise, or anti-clockwise?
So we can use this common gesture for user to rotate object?
Thank you.
Hey Vincent,
We dont support finger tracking at this time so there's no way to exactly attach an object to finger however you can edit the position in 2D editor to be close to the fingers.
Hope you will find this helpful.
Best,
Amir.