[Kstars-devel] XYZ Rotation matrix in 3.5.x
James Bowlin
bowlin at mindspring.com
Fri Jun 16 00:07:38 CEST 2006
On Thursday 15 June 2006 12:57, James Bowlin wrote:
> kstars: Coord grid : 125 ms
> kstars: Equator : 59 ms
> kstars: Horizon : 54 ms
The previous patch for skycomponents/coordinategridcomponent.cpp dropped
the time down for the coordinate grid down to about 10 ms.
I looked at the equator code and found that the big time consumer there
is drawing the label in the rotated coordinate system. At the bottom
of skycomponents/equatorcomponent.cpp there is the following code:
psky.save();
if ( Options::useAntialias() )
psky.translate( o.x(), o.y() );
else
psky.translate( int(o.x()), int(o.y()) );
psky.rotate( double( angle ) ); //rotate the coordinate system
psky.drawText( 0, 0, i18n( "Equator" ) );
psky.restore(); //reset coordinate system
}
}
If I comment out either the psky.rotate() or the psky.drawText() then the
time drops from over 50 ms down to under 5 ms. I don't have the detailed
timing code in my 3.5 branch so I can't immediately see if it also requires
50 ms to draw rotated text but this time seems excessive to me. I think
we could do it ourselves 10 times or more faster by drawing the text in
a way that is similar to the way we draw the Milky Way. My guess is that
this is something that might get improved upstream.
In the meantime, if we just skip rotating the labels for the equator and
the horizon, we can probably save over 100 ms or so per draw cycle (on
my 1.6 GHz laptop).
--
Peace, James
More information about the Kstars-devel
mailing list