简体   繁体   中英

How can I simulate a double-tap event on a Scene View

Background: I have an app presenting a 3D model with SceneKit. By default SceneKit has a function that once the user makes a double-tap, the 3D model returns into its original position. I want to use this feature programmatically. When the user hits a certain button, the 3D model shall return to its original position. Therefore, I would like to fire a double-tap event if possible and hope that the 3D model will react accordingly. How can this be done?

This question relates to another case How to retrieve information about the camera position in a sceneKit project when the 3D model is zoomed? in which I try to resolve this task by setting the cameranode positions to their original value. But obviously this is not possible. The fake of the double-click would be a kind of work around in order to achieve the requirement for my application.

As mentioned in https://stackoverflow.com/a/24768474/2997825 and https://stackoverflow.com/a/70779030/2997825 SceneKit will create a new node and set it as the point of view when an interaction starts.

To revert to the original camera, you can simply set the pointOfView property back to the original, untouched, camera node.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM