glob3mobile / g3m

The multiplatform advanced visualization framework
http://www.glob3mobile.com/
Other
117 stars 56 forks source link

3d object rotating over the poles #102

Closed walterkonnerth closed 9 years ago

walterkonnerth commented 9 years ago

Hi,

I noticed that the 3d object is rotating for 180 degrees when simulating a trajectory over the poles. How can I avoid it?

DiegoGomezDeck commented 9 years ago

Hello @walterkonnerth

Can you show the code that produces this behavior?

walterkonnerth commented 9 years ago

Hi, I have a 3d object from a JSON. I made a periodical task and in its run method I calculate its position and display it then on the globe:

            3dObject.setScale(10000)
            3dObject.setPitch(AngleWrapper.fromDegrees(270));
            3dObject.setHeading(AngleWrapper.fromDegrees(0));

3dObject.setPosition( Geodetic3DWrapper( latitude: AngleWrapper.fromDegrees(_latitude), andLongitude: AngleWrapper.fromDegrees(_longitude), andHeight: _altitude))

I made some wrappers because I am programming in Swift. When the _latitude is > 70 (near the North Pole) the object is beginning to rotate, the object is facing towards the middle of the North Pole. What formula do I have to use for the heading near the poles so the heading will not change?

DiegoGomezDeck commented 9 years ago

Hi @walterkonnerth

I don't think I follow you.

Do you mean that heading=0 makes the Shape always face to the north? If yes, it's the intended behavior, see: http://en.wikipedia.org/wiki/Course_%28navigation%29#Aircraft_heading

DiegoGomezDeck commented 9 years ago

Hi @walterkonnerth, did you solve your problem? Can I close this issue?

walterkonnerth commented 9 years ago

Hi Gomez,

You can close the issue. I was not familiar with the plane orientation above the Earth but I read about it and managed to solve the problem.

Regards,

Walter On May 25, 2015 5:27 PM, "Diego Gomez Deck" notifications@github.com wrote:

Hi @walterkonnerth https://github.com/walterkonnerth, did you solve your problem? Can I close this issue?

— Reply to this email directly or view it on GitHub https://github.com/glob3mobile/g3m/issues/102#issuecomment-105243322.