I've been trying to find a good solution for a DIY SpaceMouse for a while; I've built the Space Mushroom, the Spacefox, and SalimBenbouz's 3DOF SpaceMouse. Each are excellent projects that you should definitely check out, and building them has given me alot of knowledge to work off of.
I came across an ad for adafruit's 9DOF BNO085 sensor and it looks like the perfect device to try to utilize for this project.