The forum on this site is closed for new comments and posts. Continue the conversation in the new forum, and learn more here.

How to Move or rotate 2D, 3D image in hand recognition without scaling the size?

  • 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.



    Comment actions Permalink
  • 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.



    Comment actions Permalink
  • 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.



    Hope this will help you.



    Comment actions Permalink
  • 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.


    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.



    Comment actions Permalink
  • 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.




    Comment actions Permalink

We're here to help! We just need a little bit of information...

What system are you using?

Have you downloaded the latest version of Lens Studio?

Please download the latest version of Lens Studio. If you still run into this issue, please come back and report it!

Is this issue causing Lens Studio to crash?

What system do you run Lens Studio on?



Follow the next steps to help us solve your issue:

  • Copy and paste this text into your TerminalCommand Window
    open ~/Library/Preferences/Snap/Lens\ Studio/ %LOCALAPPDATA%\Snap\Lens Studio Copy Text
  • Press ReturnEnter to run the command. The Lens Studio folder will automatically open
  • Prepare to upload your files: zip the "Log" Folder by right-clicking and choosing "compress."
    Locate the Log.txt file right above it.

    Attach a screenshot of the issue:



What is this most relevant to?

Please enter a brief description of your issue:

Thanks for submitting this issue.

Unfortunately, it's likely due to the operating system or hardware you're using – since they don't meet the system requirements for Lens Studio.

Still, we hear you loud and clear, and are logging the issue in case there's ever a workaround we can provide!

Minimum Requirements

Operating System: Windows 10 (64 bit); MacOS 10.11+

Hardware: Minimum of Intel Core i3 2.5Ghz or AMD Phenom II 2.6Ghz with 4 GB RAM; Intel HD Graphics 4000 / Nvidia GeForce 710 / AMD Radeon HD 6450 or better; screen resolution of 1280x768 or higher

We'll try to resolve this issue as soon as possible. Thanks for letting us know about it!

Keep an eye out for a followup email from us. We may have a couple more questions for you, or we might already have a solution to offer.

Happy creating!