Gabriel Glenn
Gabriel Glenn

Reputation: 1264

Android Augmented Reality App : Rotate spherical coordinate to device coordinate system

I'm creating a android AR app.

My goal is to print on the device screen a element located using spherical coordinate (bearing, elevation, distance is not relevant in my case) in the user coordinate system (North, Down, East). e.g. : North pole this (0°, 0°). (90°, 10°) would be at my East, 10° above the ground.

Using with Android getRotationMatrix and co, I was able to print a element located using cartesian coordinate (x, y, z) in the user coordinate system. This is roughly the matrix product of the element vector and the rotation matrix, rotating from user coord system to device coord system.

But what about spherical coordinate ? Do I have to hand write this rotation matrix ? I cannot find resources about spherical coordinate and rotation matrix... I must be missing something...

I thought about transforming spherical coordinate to cartesian, but it just seems like a workaround.

I don't use any extra framework (but I can if needed).

Upvotes: 0

Views: 745

Answers (1)

Related Questions