Reputation: 1264
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
Reputation: 1264
After digging in Stack Exchange Mathematics, it seems that converting to cartesian coordinate is the way to go. See :
https://math.stackexchange.com/questions/59255/can-you-not-rotate-spherical-coordinates https://math.stackexchange.com/questions/92301/transforming-from-one-spherical-coordinate-system-to-another Rotating body from spherical coordinates
Upvotes: 0