The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
scale object using navigation
tried to scale object with navigation using the same way to rotate in GestureAction.cs. object only flattened into piece of plane on hold and drag. i'm trying to scale object only in y-direction. here's sample script:private float ScaleSensitivity = 2.0f; private float scalingFactor; void Update() { PerformScale(); } private void PerformScale() { if (GestureManager.Instance.IsNavigating && GazeManager.Instance.FocusedObject == gameObject { scalingFactor = GestureManager.Instance.NavigationPosition.y; GazeManager.Instance.FocusedObject.transform.localScale = new Vector3(transform.localScale.x, transform.localScale.y * scalingFactor, transform.localScale.z); } }
I've managed to scale in 3 directions using manipulation but not navigation. NavigationY is already a recognizable gesture for NavigationRecognizer in GestureManager.cs.
any advice what went wrong?
Best Answers
-
HoloSheep mod
Have you tried a debug.log line where you are setting the scalingFactor to see what the value is getting set to, you might also try logging the 3 values that you are using in the new Vector3 call to make sure they are what you expect?
You reference "transform.localScale." for each of the x, y, z values of your new scale vector, but it isn't clear as to what the gameobject is that you want to read those values from. You might want to either include the "GazeManager.Instance.FocusedObject" qualification to those lines or shorten things up by creating a gameObject variable to reference and qualify the transform in those 3 cases.
HTH.
Windows Holographic User Group Redmond
WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings6 -
HoloSheep mod
You might want to consider multiplying by Time.deltaTime instead of a fixed control value to deal with the framerate speed of the Update routine.
Glad to hear you got it work and happy help.
Windows Holographic User Group Redmond
WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings5
Answers
@felsiska
Have you tried a debug.log line where you are setting the scalingFactor to see what the value is getting set to, you might also try logging the 3 values that you are using in the new Vector3 call to make sure they are what you expect?
You reference "transform.localScale." for each of the x, y, z values of your new scale vector, but it isn't clear as to what the gameobject is that you want to read those values from. You might want to either include the "GazeManager.Instance.FocusedObject" qualification to those lines or shorten things up by creating a gameObject variable to reference and qualify the transform in those 3 cases.
HTH.
Windows Holographic User Group Redmond
WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings
@HoloSheep
found out that GestureManager.Instance.NavigationPosition runs very fast. so had to * 0.05f to control the scale. now works well. thx for the advice anyways!
@felsiska
You might want to consider multiplying by Time.deltaTime instead of a fixed control value to deal with the framerate speed of the Update routine.
Glad to hear you got it work and happy help.
Windows Holographic User Group Redmond
WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings