I'm trying to implement stay-on-screen feature in my work using example from Piotr Adam Milewski.
But I couldn't able to do it. I'm a beginner in JavaScript, since it is required for web ar I'm learning it.I have created nft example and I'm planning to include features like gesture-controls(like rotation and scaling) and I wanted it to be stay-on-screen.
This is my work
And you can check it live here
Using this image
Problem I'm facing:
1.I couldn't able to position my model exactly center to nft.
2.when I include rotation factor for my model(-90 0 0), the rotation feature through hand gesture works but not in proper manner. If I remove rotation for my model then rotation through hand/mouse works good but the model will be inverted.
3.And I wanted to include stay-on-screen, but I'm having lack of knowledge to implement in my code.