How to geometrically align a 3D model to real furniture?
For my video-see-through AR application I want a model to automatically be placed on the biggest found table surface. I achieved the first step: The model is correctly positioned at the table center. However, the orientationis not correct. I want the model to "lie down" on the table, means laying on the back, facing up, while the longest side of the model is orientated just as the longest side of the table - see the following pictures: After a very long time trying, I could not figure out how to align the model correctly. If you have any idea/hint/ or clue I could try, please let me know. Used Asset for testing: Low Poly Human I added an Empty (called ModelPlacer) where I added the script (see below) and pulled this asset in the modelInstance field. Used Meta XR Building Blocks: Camera Rig Passthrough MR Utility Kit Scene Debugger Effect Mesh Hand Tracking Controller Tracking Technical Specifications: Unity 2022.3.50f1 VR-Glasses: Meta Quest 3 Meta MR Utility Kit Code: using Meta.XR.MRUtilityKit; using System.Collections; using System.Collections.Generic; using UnityEngine; public class ModelPlacer : MonoBehaviour { public GameObject modelPrefab; private GameObject modelInstance; void Start() { MRUK.Instance?.RegisterSceneLoadedCallback(OnSceneLoaded); } private void OnSceneLoaded() { SpawnModel(); AlignModelWithSurface(); } public void SpawnModel() { Vector3 spawnPosition = new Vector3(0.0f, 1.0f, -1.0f); modelInstance = Instantiate(modelPrefab, spawnPosition, Quaternion.identity); } public void AlignModelWithSurface() { var largestSurface = MRUK.Instance?.GetCurrentRoom()?.FindLargestSurface(MRUKAnchor.SceneLabels.TABLE); if (modelInstance != null) { if (largestSurface != null) { modelInstance.transform.SetParent(largestSurface.transform); Renderer modelRenderer = modelInstance.GetComponent<Renderer>(); modelInstance.transform.rotation = Quaternion.Euler(-90, 0, 0); Vector3 modelCenter = modelRenderer.bounds.center; Vector3 surfaceCenter = largestSurface.transform.position; Vector3 positionOffset = surfaceCenter - modelCenter; Vector3 adjustedPosition = modelInstance.transform.position + positionOffset; modelInstance.transform.position = adjustedPosition; } else { Debug.LogWarning("No surface found."); } } else { Debug.LogWarning("modelInstance is null."); } } }941Views0likes3CommentsHow to start the VR app in VR mode from Unity IDE in Horizon Workrooms?
I am trying to use Horizon Workrooms as developer environment for VR development. I can edit scene and source code in Horizon Workrooms. But when I start the app in Unity IDE, it starts in flatscreen mode instead of VR mode. PC Oculus Home runs VR apps from Unity IDE in VR mode, but it cannot track Logitech K830 keyboard, Is it possible using Horizon Workrooms to start the VR app from Unity IDE in VR mode?1.3KViews1like1CommentOVRPlugin.GetSystemHeadsetType() doesn't return Oculus_Quest_2
I added the OVRController prefab to my project but on Quest 2 it always shows the controllers for te Quest. Thi is because OVRPlugin.GetSystemHeadsetType() always returns Oculus quest even if I'm using Oculus Quest 2. I'm working with the latest version of th Oculus Integration. Does anyone have the same problem?1.8KViews1like3CommentsStruggling with raycast interaction from oculus integration sdk
Hello guys, so I was trying to build a VR app. I was using oculus integration sdk. I know there is interactable unity event wrapper for assigning functions when an object is clicked using raycaster. When select event and we assign function by adding to the list in inspector. For me models are loaded at run time and I want to assign a function to the model when it is selected via raycaster through script. Like instead of adding in inspector, I want to assign a function to when select via script. How can I do it?. Struggling with this for hours now1.7KViews0likes1CommentFirst VR App tutorial errors
Hey guys, I started the build your first VR app tutorial here from oculus, but I keep getting NullReferenceException errors from the ColorController.cs file. Here is where I get the errors: // Assigns the component's renderer instance rend = GetComponent<Renderer>(); rend.enabled = true; displayText.text = ""; // Checks if the player ball has collided with the wall. if (col.gameObject.name == "player-ball") { displayText.text = "Ouch!"; rend.sharedMaterial = wallMaterial[0]; } // It is called when the ball moves away from the wall private void OnCollisionExit(Collision col) { if (col.gameObject.name == "player-ball") { rend.sharedMaterial = wallMaterial[1]; displayText.text = "Keep Rolling..."; } } I am not able to see the text change whenever the ball is rolling, or when it hits the wall. The app runs fine other than that. Please let me know if you guys have any solutions/tips. Thank you.1.4KViews0likes3CommentsTracking Mode Floor
Hi, I have a question about the Tracking Mode. If I use Floor and try to recenter in the Oculus Home Menu, my Characater's Y Position changed to a different one. I thought Tracking mode Floor is always the correct height above the floor or am I wrong. Thanks in advice1.8KViews0likes2Comments[help] Oculus Quest and Linear Color?
Hi! hope you're all well. When exporting my Unity URP project to the Quest and running it on the headset, the gamma is fucked up. Everything looks darker and saturated, while the Windows build and the previz through Link render as expected. The thing is, when I started this project, the early builds would sometimes display the correct gamma (sometimes it would take a few app restarts), while now it's always stuck with the wrong one. Has this happened to you? I found some old posts about a similar issue with Unity + GearVR and it seemed to be an Android thing, but the official Oculus recommendations say explicitly to use Linear Color, and so does every 'setup' tutorial video I've found. I'd appreciate any input, I've already asked Reddit without success.3.1KViews0likes2CommentsThoughts/ Experience and advice on best setup for a new commercial release for Quest.
We are beginning production on a commercial title for the Quest and I am looking for the general consensus on what other developers think is the best setup to go for. Our current options seem to be - - A 2019 LTS Unity using Oculus Integration package - 2020 Unity using Unity XR Plugin We are required to have hand tracking support, and from what I have read Unity XR Plugin doesn't currently support this. I have experience in the now deprecated Oculus Integration package and Unity XR looks like it could be a great solution for us, but it is also in preview and missing features we might/do need. With the Unity XR plugin how do we get access to Avatars, play space info etc I'm looking for some thoughts on what experience people have had, I dont know of any commercial releases with Unity's XR plugin yet! Thanks!712Views0likes0CommentsAttempting to retrieve APK runtime version number showing 0.0.0.0 fail
I am using Assembly.GetExecutingAssembly().GetName().Version.ToString() to get apk runtime version number. I have the same call in another apk that is not pushed to Oculus but runs on phones. That works. The Quest reports 0.0.0.0. Anybody else run across this?914Views0likes0CommentsIs there a way to check if player goes outside of the guardian play area on quest within Unity?
I have some objects that follow the player's position. Problem occurs when the player goes outside of the play area and then upon reentry, the objects dissappear. What I would like to happen is to reset the position of said objects to their original position when the player moves outside of the play area/ tracking becomes lost. I've tried subscribing to the OVRManager.TrackingLost and OVRManager.TrackingAcquired events on each of the objects. These seem to work when I use the headset with Oculus link. However it doesn't work when I make a quest build as the objects disappear when moving outside of the guardian boundary. I'm unsure if they're being destroyed or moving to a position that's out of view, I don't have a console on the quest build. I've been reading the OVRBoundary page (sorry can't post links yet) which suggests that it should be possible to get what I need by using the OVRBoundary. However, there is no code examples on how this could be achieved and clicking on the Developer Reference link takes be back to the same site. Would appreciate on some guidance from anyone who have solved this issue before. Basically I just need to know when the player moves outside of the play space (to the point where to headset asks the player to move back in or set up a new play area) and when the player reenters to play area. I figure I should be able to reset the objects when I know how to do that. Thanks1.2KViews0likes0Comments