From b66905c2f6b2128e5c8cfc218e5e9c0fd643ba2d Mon Sep 17 00:00:00 2001 From: ehofman Date: Thu, 5 Nov 2009 16:58:48 +0000 Subject: [PATCH] Oops, it was the scenery up vector, not the viewer up vector --- simgear/scene/sky/sky.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/simgear/scene/sky/sky.cxx b/simgear/scene/sky/sky.cxx index 21662c66..4d833f35 100644 --- a/simgear/scene/sky/sky.cxx +++ b/simgear/scene/sky/sky.cxx @@ -152,7 +152,12 @@ bool SGSky::reposition( const SGSkyState &st, const SGEphemeris& eph, double dt SGGeod geodZeroViewPos = SGGeod::fromGeodM(st.pos_geod, 0); zero_elev = toVec3f( SGVec3d::fromGeod(geodZeroViewPos) ); - view_up = toVec3f( st.ori.backTransform(SGVec3d::e2()) ); + + // calculate the scenery up vector + SGQuatd hlOr = SGQuatd::fromLonLat(st.pos_geod); + view_up = toVec3f(hlOr.backTransform(-SGVec3d::e3())); + + // viewer location lon = st.pos_geod.getLongitudeRad(); lat = st.pos_geod.getLatitudeRad(); alt = st.pos_geod.getElevationM(); -- 2.39.5