Understanding Pointer Events in Twinfinity

Understanding Pointer Events in Twinfinity

Pointer events are a crucial aspect of modern user interfaces, encompassing interactions like mouse clicks, touchpad gestures, and touch screen inputs. These events form the backbone of interactive applications, allowing users to communicate with software through simple gestures and clicks. They are especially important in 3D environments like Twinfinity, where they enable intuitive control and manipulation of digital objects and scenes.

Integrating Pointer Events in Twinfinity

In Twinfinity, pointer events are used to enhance interaction with the digital twin environment. The following playground demonstrates how to implement basic pointer event handling for object selection:

Pointer events, basic example

 

 

This playground demonstrates the basic usage of pointer events in Twinfinity for selecting and highlighting 3D objects. It shows how to set up event listeners, identify specific pointer events, and apply changes based on user interactions, providing an intuitive way for users to engage with the 3D environment.

 

Understanding intersections

In some interactions it is necessary to know precisely where in the model the user clicked. For this we use intersections, In this example we return to a previous playground but this time around we focus at the pick result with the argument set to true.

 

This playground covers how the position specific information from the pick event can be used to place objects.

 

The long press

In Twinfinity, differentiating between a standard click and a long press allows for more interactive and dynamic experiences within your 3D models. A long press can trigger unique actions, offering an additional layer of interaction for users.

 

This and combined with other interaction options like pressing the ctrl button can create a very rich and interactive user experience.