Class SbSphericalProjection

  • public class SbSphericalProjection
    extends SbProjection
    Spherical coordinate projection. This class performs a spherical coordinate projection and is normally used with an SoProjection or SoGeoProjection node.

    Spherical coordinates can be represented using the usual coordinate classes (SbVec3f, SoMFVec3f, etc) but the three values are considered to be

    • Longitude: an angle measured in degrees in the interval [-180,180]
    • Latitude: an angle measured in degrees in the interval [-90,90]
    • Altitude (or radius): a distance in 3D units greater than zero

    The parameters are :

    <TABLE border=1 cellspacing=0 cellpadding=5>
    <TR><TD valign=_top> <B> Name </B>   <TD valign=_top> <B> Type </B>   <TD valign=_top> <B> Index </B>  <TD valign=_top> <B> Default </B>
    <TR><TD valign=_top> radius       <TD valign=_top> float        <TD valign=_top> 0            <TD valign=_top> 0
    <TR><TD valign=_top> scaleRatio   <TD valign=_top> float        <TD valign=_top> 1            <TD valign=_top> 1

    The radius parameter is an offset added to each altitude value before projection. This is useful when the altitude values are, for example, relative to sea level.

    The scaleRatio parameter is a multiplicative ratio applied to altitude values before projection. This is useful to exaggerate altitudes for visualization purposes.

    The spherical projection of a point P(lon,lat,alt) is computed as follows:

     newLon = lon * degreeToRadians
     newLat = lat * degreeToRadians
     newRadius = radius + alt * scaleRatio
     x = newRadius*cos(newlat)*cos(newlon)
     y = newRadius*cos(newlat)*sin(newlon)
     z = newRadius*sin(newlat)

    SbProjection, SoProjection
    • Constructor Detail

      • SbSphericalProjection

        public SbSphericalProjection()
      • SbSphericalProjection

        public SbSphericalProjection​(SoProjection node)