unity3d
15 TopicsMRTK2 Bounds Control Constraint Manager for Move Axis constraint not working in Unity
I was advised by Unity to post here instead of Unity's forums. In a hololens2 device I want for the user to be able to point and touch a bounding box but not scale/translate/rotate it. I'm working on Unity 2022.1.24 with MRTK 2.8.3.0 I add a Bounds Control component to the object that holds the following components: a collider and the Constrain Manager component that has a RotationAxisContraint for all=XYZ. I've also constrained scale to 1. However picking the bounding box from the corners allows the user to move the bounding box. How can I stop this translation of bounding box from happening?613Views1like0CommentsUnity3d & MRTK open Hololens 2 camera on button click and display the image in the Untiy scene after
As described in the title I have a scene wich contains a button. I attached a script with the code you see below to a ```PhotoManager``` GameObject. The button runs ```TakePhoto()``` from the script below when the button gets pressed. I expected that when you click the button, the HoloLens will open the camera and you can take a picture. Once the picture has been taken, the user should see it in the scene. However, nothing happens when you click the button... When i run the scene in unity and press the button in the game window i'm getting this error: ```InvalidOperationException: Sequence contains no elements```. (I dont have a webcam connected to my computer) The code is form the https://docs.unity3d.com/2018.4/Documentation/Manual/windowsholographic-photocapture.html. using UnityEngine; using System.Collections; using System.Linq; using UnityEngine.Windows.WebCam; public class PhotoCaptureExample : MonoBehaviour { PhotoCapture photoCaptureObject = null; Texture2D targetTexture = null; // Use this for initialization public void TakePhoto() { Resolution cameraResolution = PhotoCapture.SupportedResolutions.OrderByDescending((res) => res.width * res.height).First(); targetTexture = new Texture2D(cameraResolution.width, cameraResolution.height); // Create a PhotoCapture object PhotoCapture.CreateAsync(false, delegate (PhotoCapture captureObject) { photoCaptureObject = captureObject; CameraParameters cameraParameters = new CameraParameters(); cameraParameters.hologramOpacity = 0.0f; cameraParameters.cameraResolutionWidth = cameraResolution.width; cameraParameters.cameraResolutionHeight = cameraResolution.height; cameraParameters.pixelFormat = CapturePixelFormat.BGRA32; // Activate the camera photoCaptureObject.StartPhotoModeAsync(cameraParameters, delegate (PhotoCapture.PhotoCaptureResult result) { // Take a picture photoCaptureObject.TakePhotoAsync(OnCapturedPhotoToMemory); }); }); } void OnCapturedPhotoToMemory(PhotoCapture.PhotoCaptureResult result, PhotoCaptureFrame photoCaptureFrame) { // Copy the raw image data into the target texture photoCaptureFrame.UploadImageDataToTexture(targetTexture); // Create a GameObject to which the texture can be applied GameObject quad = GameObject.CreatePrimitive(PrimitiveType.Quad); Renderer quadRenderer = quad.GetComponent<Renderer>() as Renderer; quadRenderer.material = new Material(Shader.Find("Custom/Unlit/UnlitTexture")); quad.transform.parent = this.transform; quad.transform.localPosition = new Vector3(0.0f, 0.0f, 3.0f); quadRenderer.material.SetTexture("_MainTex", targetTexture); // Deactivate the camera photoCaptureObject.StopPhotoModeAsync(OnStoppedPhotoMode); } void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result) { // Shutdown the photo capture resource photoCaptureObject.Dispose(); photoCaptureObject = null; } }1.9KViews0likes0CommentsAugmented Reality for children at Great Ormond Street Hospital
First published on MSDN on May 10, 2018 Guest blog by Ayushmaan Seth Microsoft Student Partner and 1st Year Computer Science, University College LondonAbout me I am a 1st year Computer Science Undergraduate student at University College London.1.1KViews0likes0CommentsMaking games with C# and Unity – Beginner’s Tutorial
First published on MSDN on Feb 24, 2018 Guest post by Sondre Agledahl: Games programmer, CS student and Microsoft Student Partner at UCLMicrosoft Student Partners ran an introductory workshop to game development with C# and Unity at UCL.3.7KViews0likes0CommentsMixed Reality Immersive– A Beginners guide to building for MR
First published on MSDN on Oct 09, 2017 Guest post by Simon Jackson MVP Windows DevelopmentWith the recent release of the Microsoft Mixed Reality headsets, controllers and the awesome Fall Creators update for Windows 10, it has never been a better time to immerse yourself in to the Mixed Reality space.808Views0likes0Comments