C# Inconsistent calls into GetModelExtents

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
NejedlyJ
Posts: 2
Joined: Mon Oct 02, 2023 12:26 am

C# Inconsistent calls into GetModelExtents

Post by NejedlyJ »

Hello,
I'm writing a C# application where users are able to hide parts of the displayed models. This affects the center of a scene which is also the point around which I would like to rotate the view. The SpaceMouse driver queries the information about the scene via the GetModelExtents() method. However, in some cases this method is called after the user has finished the input with the space mouse. I think that this behavior doesn't make any sense as the information about the scene should be queried prior to the input. The consequence of this is that the center of rotation is outdated. This behavior is inconsistent and when I was attempting to replicate the issue, sometimes the GetModelExtents was called during the input as it should have been.

I would like to know if this is an issue on the side of SpaceMouse driver or whether our implementation is flawed. The SDK version that we are using is 4.0.3r19962 and the driver version on my development machine is 10.8.12.3545.

Previously, our application was using older approach with the message pump and all the transformation logic was handled on our end. However, we would like to get a certification for our app and one of the requirements was the usage of the newest SDK, which doesn't include any support for raw input. On the other hand, I understand that handling the transformations in the driver leads to more consistent feel of the SpaceMouse across different apps for the user.

Best regards,
Jaroslav Nejedlý
ngomes
Moderator
Moderator
Posts: 3344
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: C# Inconsistent calls into GetModelExtents

Post by ngomes »

NejedlyJ wrote: Tue Oct 03, 2023 1:32 am I would like to know if this is an issue on the side of SpaceMouse driver or whether our implementation is flawed.
Probably neither.

Calculating the "model extents" can be an expensive operation and the Navigation Library may move it to after the user has released the sensor cap of the SpaceMouse since it is the only time where the application may go into idling.

If the "model extents" has changed, you can "write" the property to keep it up-to-date even if the SpaceMouse sensor is not active.
Nuno Gomes
NejedlyJ
Posts: 2
Joined: Mon Oct 02, 2023 12:26 am

Re: C# Inconsistent calls into GetModelExtents

Post by NejedlyJ »

Thank you for your reply. Setting the properties directly will also solve many other minor issues that I'm experiencing.

Best regards,
Jaroslav Nejedlý
Post Reply