Posts

CAGD 458 - Blog Post 2 - 4/12/2026

Image
This sprint I finalized the compass getting it to track the devices orientation, it is not perfect, but it is very close to what a compass app would show you. In the demo, the compass rotates in real time as the device turns, and that movement is driven by a JavaScript bridge that listens to deviceorientation events in the browser. I handle multiple heading cases in the JavaScript, using alpha when absolute data is available, falling back to webkitCompassHeading on iOS, and converting values when needed to keep the heading consistent. That value is sent into my UpdateHeading method using SendMessage, where I parse it and store it as the current heading. I also added validation checks to make sure the value is not NaN or invalid before applying it, which helped prevent occasional glitches where the compass would jump or freeze. To make the compass feel stable, I focused heavily on filtering and smoothing the incoming data. I use Mathf.DeltaAngle to calculate the difference between the c...

CAGD 458 - Blog Post 1 - 3/29/2026

Image
       This project has been much different from my others as I have only really programmed for videogames and in those games, we were not asking for much of the players device information. This time around we need a whole bunch of stuff from players and for me those permissions mean I do not use Unity C# like I have been using for the last 3 or so years. It has been really hard this print because it seemed much shorter than others because we had spring break and I was unable to work on the game during that time and when we got back, I was trying to figure out how to do this compass for the game. It has been extra difficult because in the game we are using the device location to determine where the player is rather than a player object in the game, because of this I need to grab some permissions from the device and it has been a small struggle as I have never had to do that until now and I have found out that I actually need to use a JavaScript and plug it in to Unit...