当前位置: 首页>>代码示例>>C++>>正文


C++ Observer::getOrientationf方法代码示例

本文整理汇总了C++中Observer::getOrientationf方法的典型用法代码示例。如果您正苦于以下问题:C++ Observer::getOrientationf方法的具体用法?C++ Observer::getOrientationf怎么用?C++ Observer::getOrientationf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Observer的用法示例。


在下文中一共展示了Observer::getOrientationf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: viewCenter


//.........这里部分代码省略.........
        }
        glEnd();
        
        // Place labels at the intersections of the view frustum planes
        // and the parallels.
        Vec3d center(0.0, 0.0, sinPhi);
        Vec3d axis0(cosPhi, 0.0, 0.0);
        Vec3d axis1(0.0, cosPhi, 0.0);
        for (int k = 0; k < 4; k += 2)
        {
            Vec3d isect0(0.0, 0.0, 0.0);
            Vec3d isect1(0.0, 0.0, 0.0);
            Renderer::LabelAlignment hAlign = getCoordLabelHAlign(k);
            Renderer::LabelVerticalAlignment vAlign = getCoordLabelVAlign(k);

            if (planeCircleIntersection(frustumNormal[k], center, axis0, axis1,
                                        &isect0, &isect1))
            {
                string labelText = latitudeLabel(dec, decIncrement);

                Point3f p0((float) isect0.x, (float) isect0.z, (float) -isect0.y);
                Point3f p1((float) isect1.x, (float) isect1.z, (float) -isect1.y);

#ifdef DEBUG_LABEL_PLACEMENT
                glPointSize(5.0);
                glBegin(GL_POINTS);
                glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
                glVertex3f(p0.x, p0.y, p0.z);
                glVertex3f(p1.x, p1.y, p1.z);
                glColor(m_lineColor);
                glEnd();
#endif
                
                Mat3f m = conjugate(observer.getOrientationf()).toMatrix3();
                p0 = p0 * orientationf.toMatrix3();
                p1 = p1 * orientationf.toMatrix3();
                
                if ((p0 * m).z < 0.0)
                {
                    renderer.addBackgroundAnnotation(NULL, labelText, m_labelColor, p0, hAlign, vAlign);
                }
                
                if ((p1 * m).z < 0.0)
                {
                    renderer.addBackgroundAnnotation(NULL, labelText, m_labelColor, p1, hAlign, vAlign);
                }                
            }
        }
    }

    // Draw the meridians

    // Render meridians only to the last latitude circle; this looks better
    // than spokes radiating from the pole.
    double maxMeridianAngle = PI / 2.0 * (1.0 - 2.0 * (double) decIncrement / (double) DEG_MIN_SEC_TOTAL);
    minDec = std::max(minDec, -maxMeridianAngle);
    maxDec = std::min(maxDec,  maxMeridianAngle);
    arcStep = (maxDec - minDec) / (double) ARC_SUBDIVISIONS;
    double phi0 = minDec;

    double cosMaxMeridianAngle = cos(maxMeridianAngle);

    for (int ra = startRa; ra <= endRa; ra += raIncrement)
    {

        double theta = 2.0 * PI * (double) ra / (double) totalLongitudeUnits;
开发者ID:jpcoles,项目名称:ZM,代码行数:67,代码来源:skygrid.cpp


注:本文中的Observer::getOrientationf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。