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


C++ Point3::getZ方法代码示例

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


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

示例1: psi

static Vector3 SamplePotential(Point3 p)
{
   Vector3 psi(0,0,0);
   Vector3 gradient = ComputeGradient(p);

   float obstacleDistance = SampleDistance(p);

   // add turbulence octaves that respect boundaries, increasing upwards
   float height_factor = ramp((p.getY() - PlumeBase) / PlumeHeight);
   for (unsigned int i=0; i < 3; ++i) {
        Vector3 s = Vector3(p) / NoiseLengthScale[i];
        float d = ramp(std::fabs(obstacleDistance) / NoiseLengthScale[i]);
        Vector3 psi_i = BlendVectors(noise3d(s), d, gradient);
        psi += height_factor*NoiseGain[i]*psi_i;
   }

   Vector3 risingForce = Point3(0, 0, 0) - p;
   risingForce = Vector3(-risingForce[2], 0, risingForce[0]);

   // add rising vortex rings
   float ring_y = PlumeCeiling;
   float d = ramp(std::fabs(obstacleDistance) / RingRadius);
   while (ring_y > PlumeBase) {
      float ry = p.getY() - ring_y;
      float rr = std::sqrt(p.getX()*p.getX()+p.getZ()*p.getZ());
      float rmag = RingMagnitude / (sqr(rr-RingRadius)+sqr(rr+RingRadius)+sqr(ry)+RingFalloff);
      Vector3 rpsi = rmag * risingForce;
      psi += BlendVectors(rpsi, d, gradient);
      ring_y -= RingSpeed / RingsPerSecond;
   }

   return psi;
}
开发者ID:evandrewry,项目名称:glut-turbulent-billboards,代码行数:33,代码来源:Particles.cpp

示例2: lexic

bool lexic(Point3 P1, Point3 P2)
{ 
    return  P1.getX() <  P2.getX() ||
            P1.getX() == P2.getX() && P1.getY() <  P2.getY() ||
            P1.getX() == P2.getX() && P1.getY() == P2.getY() &&
            P1.getZ() <  P2.getZ();
}
开发者ID:ioivanov,项目名称:OOP-IS-15-16,代码行数:7,代码来源:point3.cpp

示例3:

Vector3 Vector3::operator^ ( Point3 v ){
	Vector3 temp;
	temp.setVector3(
			y*v.getZ() - z*v.getY(),
			z*v.getX() - x*v.getZ(),
			x*v.getY() - y*v.getX()
    );
	return temp;
}
开发者ID:RicardoBusta,项目名称:dog-project-1,代码行数:9,代码来源:Vector3.cpp

示例4: cc

            Point3 Point3::operator-(const Point3 &other) const {
                Point3 cc(getX() - other.getX(),
                          getY() - other.getY(),
                          getZ() - other.getZ());

                return cc;
            }
开发者ID:Duxiao777,项目名称:2013-mini-smart-vehicles,代码行数:7,代码来源:Point3.cpp

示例5: SetUniform

void SetUniform(const char* name, Point3 value)
{
    GLuint program;
    glGetIntegerv(GL_CURRENT_PROGRAM, (GLint*) &program);
    GLint location = glGetUniformLocation(program, name);
    glUniform3f(location, value.getX(), value.getY(), value.getZ());
}
开发者ID:kristofe,项目名称:VolumeRenderer,代码行数:7,代码来源:Utility.cpp

示例6: return

 Point3& Point3::operator*=(const Matrix3x3 &m) {
     Point3 cc = (*this) * m;
     m_x = cc.getX();
     m_y = cc.getY();
     m_z = cc.getZ();
     return (*this);
 }
开发者ID:Duxiao777,项目名称:2013-mini-smart-vehicles,代码行数:7,代码来源:Point3.cpp

示例7: SampleDistance

static float SampleDistance(Point3 p)
{
    if (!obstacle) return (0* p.getX() + 1 * p.getY() + 0 * p.getZ() - 0.75);

    float phi = p.getY();
    Vector3 u = p - SphereCenter;
    float d = length(u);
    return d - SphereRadius;
}
开发者ID:evandrewry,项目名称:glut-turbulent-billboards,代码行数:9,代码来源:Particles.cpp

示例8: renderNextImageChaseCarSensors

    void OpenGLGrabber::renderNextImageChaseCarSensors(bool renderSensors) {
        Position assignedNode = m_egoState;
        Point3 positionCamera;
        Point3 lookAtPointCamera;
        Point3 dirCamera(-10, 0, 0);
        dirCamera.rotateZ(assignedNode.getRotation().getAngleXY());
        positionCamera.setX(assignedNode.getPosition().getX() + dirCamera.getX());
        positionCamera.setY(assignedNode.getPosition().getY() + dirCamera.getY());
        positionCamera.setZ(10);

        lookAtPointCamera.setX(assignedNode.getPosition().getX());
        lookAtPointCamera.setY(assignedNode.getPosition().getY());
        lookAtPointCamera.setZ(0);

        glPushMatrix();
            glLoadIdentity();

            // Setup camera.
            gluLookAt(positionCamera.getX(), positionCamera.getY(), positionCamera.getZ(),
                      lookAtPointCamera.getX(), lookAtPointCamera.getY(), lookAtPointCamera.getZ(),
                      0, 0, 1);

            // Draw scene.
            RenderingConfiguration r = RenderingConfiguration();
            m_root->render(r);

            // Update ego position.
            Point3 dir(0, 0, m_egoState.getRotation().getAngleXY());
            m_car->setRotation(dir);
            m_car->setTranslation(m_egoState.getPosition());
            m_car->render(r);

            if (renderSensors) {
                // Render sensor FOVs
                m_sensors->render(r);
            }

        glPopMatrix();
    }
开发者ID:Jessie-SEM,项目名称:MiniatureSmartVehicle,代码行数:39,代码来源:OpenGLGrabber.cpp

示例9: while

            void Renderer2D::drawTriangleSet(const TriangleSet &ts, const Point3 &position, const Point3 &rotation) {
                vector<Point3> points;
                vector<Point3>::const_iterator it = ts.m_vertices.begin();
                while (it != ts.m_vertices.end()) {
                    Point3 p = (*it);
                    p.rotateX(rotation.getX());
                    p.rotateY(rotation.getY());
                    p.rotateZ(rotation.getZ());

                    p += position;

                    points.push_back(p);

                    it++;
                }

                drawPolyLine(points);
            }
开发者ID:TacoVox,项目名称:OpenDaVINCI,代码行数:18,代码来源:Renderer2D.cpp

示例10: render

            void Polygon::render(RenderingConfiguration &renderingConfiguration) {
                if ((getNodeDescriptor().getName().size() == 0) || (renderingConfiguration.getNodeRenderingConfiguration(getNodeDescriptor()).hasParameter(NodeRenderingConfiguration::ENABLED))) {
                    glPushMatrix();
                    {
                        glColor3d(m_color.getX(), m_color.getY(), m_color.getZ());

                        glBegin(GL_QUADS);
                        for (uint32_t i = 0; i < m_listOfGroundVertices.size() - 1; i++) {
                            const Point3 &p1 = m_listOfGroundVertices[i];
                            const Point3 &p2 = m_listOfGroundVertices[i+1];

                            Point3 P12 = p2 - p1;
                            P12.setZ(0);
                            const Point3 P1H = Point3(p1.getX(), p1.getY(), m_height);
                            const Point3 P1HxP12 = P1H.cross(P12);

                            glVertex3d(p1.getX(), p1.getY(), 0);
                            glVertex3d(p1.getX(), p1.getY(), m_height);
                            glVertex3d(p2.getX(), p2.getY(), m_height);
                            glVertex3d(p2.getX(), p2.getY(), 0);
                            glNormal3d(P1HxP12.getX(), P1HxP12.getY(), P1HxP12.getZ());
                        }
                        glEnd();

                        // Bottom of the polygon.
                        glBegin(GL_POLYGON);
                        for (uint32_t i = 0; i < m_listOfGroundVertices.size(); i++) {
                            const Point3 &p1 = m_listOfGroundVertices[i];
                            glVertex3d(p1.getX(), p1.getY(), 0);
                        }
                        glEnd();

                        // Top of the polygon.
                        glBegin(GL_POLYGON);
                        for (uint32_t i = 0; i < m_listOfGroundVertices.size(); i++) {
                            const Point3 &p1 = m_listOfGroundVertices[i];
                            glVertex3d(p1.getX(), p1.getY(), m_height);
                        }
                        glEnd();
                    }
                    glPopMatrix();
                }
            }
开发者ID:Pletron,项目名称:OpenDaVINCI,代码行数:43,代码来源:Polygon.cpp

示例11: apply

    void Camera::apply()
    {
        glLoadIdentity();

        m_pitch = (m_pitch < -cartesian::Constants::PI) ? -cartesian::Constants::PI : m_pitch;
        m_pitch = (m_pitch > -0.01f) ? -0.01f : m_pitch;

        m_orientation = Point3( sin(-m_pitch) * cos(-m_head),
                                sin(-m_pitch) * sin(-m_head),
                                cos(-m_pitch) );

        m_orientation.normalize();

        m_up = Point3( sin(-m_roll) * cos(m_pitch),
                       sin(-m_roll) * sin(m_pitch),
                       cos(-m_roll) );
        m_up.normalize();

        Point3 lookAt = m_position - m_orientation;

        gluLookAt(m_position.getX(), m_position.getY(), m_position.getZ(),
                  lookAt.getX(), lookAt.getY(), lookAt.getZ(),
                  m_up.getX(), m_up.getY(), m_up.getZ());
    }
开发者ID:TacoVox,项目名称:OpenDaVINCI,代码行数:24,代码来源:Camera.cpp

示例12: project

int Camera::project(Point3 & pos_aos,
                    int    * viewport,
                    float  * win_coord0,
                    float  * win_coord1)
{
// reimplentation of gluProject (works well with perspective projection,
// may not work with orthographic projection)
    Vectormath::Aos::Vector4 pos  = Vectormath::Aos::Vector4(pos_aos.getX(),
                                    pos_aos.getY(),
                                    pos_aos.getZ(),
                                    1.0f);
    Vectormath::Aos::Vector4 tmp0 = m_view_aos*pos;
    Vectormath::Aos::Vector4 tmp1 = m_projection_aos.getCol0()*tmp0.getX() +
                                    m_projection_aos.getCol1()*tmp0.getY() +
                                    m_projection_aos.getCol2()*tmp0.getZ() +
                                    m_projection_aos.getCol3()*tmp0.getW();

    if (tmp0.getZ() == 0.0f) return 0;

    float tmp3 = -1.0f/tmp0.getZ();
    tmp1[0] *= tmp3;
    tmp1[1] *= tmp3;

// !! normalized
    *win_coord0 = ((tmp1.getX()*0.5f+0.5f)*viewport[2]+viewport[0])/viewport[2];
    *win_coord1 = ((tmp1.getY()*0.5f+0.5f)*viewport[3]+viewport[1])/viewport[3];

//
// wind_coord2 (z)
//
// This is only correct when glDepthRange(0.0, 1.0)
// tmp1[2] *= tmp3;
// *win_coord2=(1.0f+tmp1[2])*0.5f;

    return 1;
}
开发者ID:issakomi,项目名称:mmt,代码行数:36,代码来源:camera.cpp

示例13: getCenter

            Point3 Polygon::getCenter() const {
                Point3 center;

                if (getSize() > 0) {
                    Point3 smallest = (*m_listOfVertices.begin());
                    Point3 greatest = (*m_listOfVertices.begin());

                    for(uint32_t i = 0; i < getSize(); i++) {
                        Point3 point = m_listOfVertices.at(i);

                        // Compute smallest coordinates.
                        if (point.getX() < smallest.getX()) {
                            smallest.setX(point.getX());
                        }
                        if (point.getY() < smallest.getY()) {
                            smallest.setY(point.getY());
                        }
                        if (point.getZ() < smallest.getZ()) {
                            smallest.setZ(point.getZ());
                        }

                        // Compute greatest coordinates.
                        if (point.getX() > greatest.getX()) {
                            greatest.setX(point.getX());
                        }
                        if (point.getY() > greatest.getY()) {
                            greatest.setY(point.getY());
                        }
                        if (point.getZ() > greatest.getZ()) {
                            greatest.setZ(point.getZ());
                        }
                    }

                    center = (smallest + greatest) * 0.5;
                }
                return center;
            }
开发者ID:TacoVox,项目名称:OpenDaVINCI,代码行数:37,代码来源:Polygon.cpp

示例14: setUniform

 void Shader::setUniform(const char* name, Point3 value)
 {
   GLint location = glGetUniformLocation(_programInfo->glID, name);
   glUniform3f(location, value.getX(), value.getY(), value.getZ());
 }
开发者ID:kristofe,项目名称:SimpleRenderer,代码行数:5,代码来源:shader.cpp

示例15: return

Vector3 Vector3::operator-= ( Point3 b )
{
    this->setVector3( x - b.getX() , y - b.getY() , z - b.getZ() );
    return (*this);
}
开发者ID:RicardoBusta,项目名称:dog-project-1,代码行数:5,代码来源:Vector3.cpp


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