[Marble-devel] Reference system

Torsten Rahn tackat at t-online.de
Sun May 13 12:13:28 UTC 2012


Hi,

Now I get it :-)

Yes, I can see why this kind of problem occurs with Orbit data.

Right now we basically calculate the screen positions of objects for a certain 
position inside the projection classes. See

src/lib/Projections/SphericalProjection.cpp

with methods like

bool SphericalProjection::screenCoordinates( const GeoDataCoordinates 
&coordinates,  const ViewportParams *viewport,
 qreal &x, qreal &y, bool &globeHidesPoint ) const

for example. The expensive part there is the line  qpos.rotateAroundAxis( *( 
viewport->planetAxisMatrix() ) ); which does the basic coordinate 
transformation between geodetic GeoDataCoordinates and pixel coordinates.  

I guess that would be the proper place in the code where one could introduce 
other such possible reference systems. If you really want to "save" CPU cycles 
there then you'd probably introduce an alternative planetAxisMatrix that is 
used for the rotateAroundAxis method (have a look at the other places in the 
code where the planetAxis is calculated to do this in a similar way). 
This would avoid having to "convert" the positions for all the 
GeoDataCoordinates of the Satellites. Instead you'd just create a fitting 
matrix once that would work for all :-)

We'd gladly accept patches that do this in a nice way ;) This means it should 
work for all projections with a nice API. Ideally you'd also provide some 
basic unit regression tests :)

BR,

Torsten


 



On Sonntag, 13. Mai 2012 13:20:14 marble_developer marble_developer wrote:
> Hi,
> 
> I will try to explain it a bit better.
> 
> When the Earth turns the corresponding angle in each update of Marble
> clock, the points added turn the same angle too, it's the normal behaviour
> in Marble because the reference system rotates with the Earth globe.
> 
> In this case, a point that has the next values for lon, lat and alt doesn't
> generate an orbit. lon, lat, alt = (0, 0, 20000 * 1000). The point is drawn
> always in the same point of space.
> 
> I want that the points remain fixed in the space and they doesn't turn with
> the Earth.
> 
> In this case a point that has the next values for lon, lat and alt
> generates an orbit. lon, lat, alt = (0, 0, 20000 * 1000). The point is
> drawn in differents points of space because the point drawn remain fixed in
> space.
> 
> For example, we consider that the update interval of Marble clock is 10800
> s, (10800 s is the time that the Earth use to turn 45º) and that a point
> with values lon, lat, alt = 0,0, 20000 * 1000 is added in each update of
> Marble clock. At first, when the time is 0 s, the point p is drawn in 0,0,
> 20000 * 1000, then, when the time is 10800 s, the point p is drawn in 0,0,
> 20000 * 1000 but the last point p' is in -45, 0, 20000 * 1000 respect the
> new point p.
> 
> I have performed this behaviour by recalculating the new lon position in
> every update but it's very slowly when the number of points is elevated.
> 
> How can I do this task in a better way? Is it possible to change the
> reference system using in Marble?
> 
> Regards.
> 
> 2012/5/7 marble_developer marble_developer <marbledeveloper at gmail.com>
> 
> > Hi all,
> > 
> > Is it possible to change the reference system using in Marble?
> > In affirmative case, how can I change it?
> > I need to use an inertial reference system instead of fixed reference
> > system.
> > 
> > Best regards.


More information about the Marble-devel mailing list