本文整理汇总了C++中Matrix4d::ptr方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4d::ptr方法的具体用法?C++ Matrix4d::ptr怎么用?C++ Matrix4d::ptr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4d
的用法示例。
在下文中一共展示了Matrix4d::ptr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw_mesh
void AABB::draw_mesh()
{
glColor3d(color[0],color[1],color[2]);
Vector3d n;
glPushMatrix();
glTranslated(-center[0], -center[1], -center[2]);
Matrix4d R(q_now);
Matrix4d RT = R.transpose();
glMultMatrixd(RT.ptr());
glScaled(zoom_val,zoom_val,zoom_val);
glBegin(GL_TRIANGLES);
for(unsigned int j=0;j<p.size();++j) {
glVertex3dv(p[j].ptr());
}
glEnd();
glPopMatrix();
glColor3d(color[0],color[1],color[2]);
Vector3d u=q_now*p[0]*zoom_val-center,
v=q_now*p[1]*zoom_val-center,
w=q_now*p[2]*zoom_val-center;
glBegin(GL_TRIANGLES);
glVertex3dv(u.ptr());
glVertex3dv(v.ptr());
glVertex3dv(w.ptr());
glEnd();
}
示例2: paintGL
void CGView::paintGL() {
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0,0,-2);
Matrix4d R(q_now);
Matrix4d RT = R.transpose();
glMultMatrixd(RT.ptr());
glScaled(zoom,zoom,zoom);
glTranslated(-center[0],-center[1],-center[2]);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
drawMesh();
}
示例3: draw
void OBB::draw(){
glPushMatrix();
glTranslated(-center[0], -center[1], -center[2]);
Matrix4d R(q_now);
Matrix4d RT = R.transpose();
glMultMatrixd(RT.ptr());
glScaled(zoom_val,zoom_val,zoom_val);
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
//glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
glDisable(GL_LIGHTING);
//glColor4d(color.x(),color.y(),color.z(),0.2);
glColor3d(0,0,0);
glPointSize(25);
glBegin(GL_POINTS);
glVertex3d(0,0,0);
Matrix4d m=this->R.transpose();
for (int i = 0; i < 3; ++i) {
Vector3d c=0;
c[i]=1;
c=m*c;
c=c/c.length()/16;
glVertex3dv(c.ptr());
}
glEnd();
glBegin(GL_QUAD_STRIP);
for(unsigned int i=0; i<corner.size();i++){
glVertex3dv(corner[i].ptr());
}
glVertex3dv(corner[0].ptr());
glVertex3dv(corner[1].ptr());
glEnd();
glEnable(GL_LIGHTING);
glPopMatrix();
}
示例4: paintGL
void CGView::paintGL() {
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslated(-g_center[0],-g_center[1],-g_center[2]);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
Matrix4d R(q_now);
Matrix4d RT = R.transpose();
glMultMatrixd(RT.ptr());
glScaled(zoom,zoom,zoom);
if (bbox_on) drawBoundingBox();
GLUquadricObj *quadric;
quadric = gluNewQuadric();
glDisable (GL_CULL_FACE);
if(!(show_circle&&max4Points)){
for(unsigned int i=0;i<point.size();i++) {
if (i == picked) glColor3d(1.0,0.0,0.0);
else glColor3d(1.0,1.0,0.0);
glPushMatrix();
glTranslated(point[i][0],point[i][1],point[i][2]);
//glutSolidSphere(0.03,10,10);
gluQuadricDrawStyle(quadric, GLU_FILL);
gluSphere( quadric , .03 , 10 , 10);
glPopMatrix();
}
}
else{
for(int i=0;i<=pointCount;i++) {
if (i == picked) glColor3d(1.0,0.0,0.0);
else glColor3d(1.0,1.0,0.0);
glPushMatrix();
glTranslated(point[i][0],point[i][1],point[i][2]);
gluQuadricDrawStyle(quadric, GLU_FILL);
gluSphere( quadric , .03 , 10 , 10);
glPopMatrix();
}
}
if (show_circle){
if(max4Points)
setSES();
else
SES = Sphere::com (point);
/*
glColor3d(0.0,1.0,1.0);
glPushMatrix();
glTranslated(SES.center.x(), SES.center.y(), SES.center.z());
gluQuadricDrawStyle(quadric, GLU_FILL);
gluSphere( quadric , .03 , 10 , 10);
glPopMatrix();
if(pointCount==2){
glColor3d(0.0,0.0,0.0);
glPushMatrix();
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
glBegin(GL_TRIANGLES);
glVertex3dv(point[0].ptr());
glVertex3dv(point[1].ptr());
glVertex3dv(point[2].ptr());
glEnd();
glPopMatrix();
}*/
glEnable(GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable (GL_CULL_FACE);
glColor4d(0.0,0.0,1.0,0.5);
glCullFace (GL_BACK);
glPushMatrix();
glTranslated(SES.center.x(), SES.center.y(), SES.center.z());
gluQuadricDrawStyle(quadric, GLU_FILL);
gluSphere( quadric , SES.radius , 40 , 40);
//glutSolidSphere(SES.radius,40,40);
glPopMatrix();
}
}