本文整理汇总了C++中Point3::cross方法的典型用法代码示例。如果您正苦于以下问题:C++ Point3::cross方法的具体用法?C++ Point3::cross怎么用?C++ Point3::cross使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point3
的用法示例。
在下文中一共展示了Point3::cross方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
}