June 16, 2024, 7:05 p.m. | kurohuku

DEV Community dev.to




Follow the HMD



Overlay following the HMD





Remove the position code


First, remove the absolute position code we added in the previous part.



private void Start()
{
InitOpenVR();
overlayHandle = CreateOverlay("WatchOverlayKey", "WatchOverlay");

var filePath = Application.streamingAssetsPath + "/sns-icon.jpg";
SetOverlayFromFile(overlayHandle, filePath);

SetOverlaySize(overlayHandle, 0.5f);

- var position = new Vector3(0, 2, 3);
- var rotation = Quaternion.Euler(0, 0, 45);
- SetOverlayTransformAbsolute(overlayHandle, position, rotation);

ShowOverlay(overlayHandle);

...





Device Index


In SteamVR, connected devices are identified with Device Index that automatically allocates from the system. …

application code part rotation

AI Focused Biochemistry Postdoctoral Fellow

@ Lawrence Berkeley National Lab | Berkeley, CA

Senior Data Engineer

@ Displate | Warsaw

Data Architect

@ Unison Consulting Pte Ltd | Kuala Lumpur, Federal Territory of Kuala Lumpur, Malaysia

Data Architect

@ Games Global | Isle of Man, Isle of Man

Enterprise Data Architect

@ Ent Credit Union | Colorado Springs, CO, United States

Lead Data Architect (AWS, Azure, GCP)

@ CapTech Consulting | Chicago, IL, United States