Hi buddies, I am trying to map a convex quadrilateral to a concave quadrilateral in 2D plane, or vice visa. Is the projective transformation a right mapping? If not, is there any transformation good for that? Thanks, Yong Hu
Hi buddies, I am trying to map a convex quadrilateral to a concave quadrilateral in 2D plane, or vice visa. Is the projective transformation a right mapping? If not, is there any transformation good for that? Thanks, Yong Hu
Yong Hu schrieb: Projective transformation maps convex shapes to convex shapes, so it is the wrong mapping. You can (bijectively) map the vertices and then make an interpolation, I guess. However, I'd have to look up the details myself (it was long ago when I learned that). If I remember well the keyword was something like "tensor product face"? Norbert
Norbert_Paul schrieb: OOPS! Just realized, that then the interior of the convex shape spills over to the exterior of the concave shape. Maybe try triangulation.
1.mapping quadrilateral to quadrilateral
Hi buddies, I am trying to map a convex quadrilateral to a concave quadrilateral in 2D plane, or vice visa. Is the projective transformation a right mapping? If not, is there any transformation good for that? Thanks, Yong Hu
2.overlapping quadrilaterals: culling question
Hello, Could someone be so kind to tell me how come the green rectangle is drawn above the red rectangle when in fact it is located below? I think this has to do with some culling option I need to enable, but I'm not sure how. Basically, if I draw the green rectangle first then the pictures appears OK, but I need the drawing to be independent of how I view it with the camera so I cannot rely on drawing one quadrilateral or the other one first. Can anyone please let me know how to fix this problem? Thanks, Neil #include <GL/glut.h> void drawCube(void) { glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glBegin(GL_QUADS); /* outer top face (red) */ glColor3f(1.0f, 0.0f, 0.0f); glNormal3f(0.0f, 1.0f, 0.0f); glVertex3f(0.0f, 1.0f, 0.0f); glVertex3f(1.0f, 1.0f, 0.0f); glVertex3f(1.0f, 1.0f, 1.0f); glVertex3f(0.0f, 1.0f, 1.0f); /* outer bottom face (green) */ glColor3f(0.0f, 1.0f, 0.0f); glNormal3f(0.0f, -1.0f, 0.0f); glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f(1.0f, 0.0f, 0.0f); glVertex3f(1.0f, 0.0f, 1.0f); glVertex3f(0.0f, 0.0f, 1.0f); glEnd(); glutSwapBuffers(); glFlush(); } void idle(void) { drawCube(); } int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); glutInitWindowPosition(120, 80); glutInitWindowSize(640, 480); glutIdleFunc(idle); glutCreateWindow("hello"); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0, 1.0, 0.0, 3.0); gluLookAt(-1.0, 3.0, -1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0); glutMainLoop(); return 0; }
3.transform between convex and concave quadrilaterals
Hi buddies, I am trying to map a convex quadrilateral to a concave quadrilateral in 2D plane, or vice visa. Is the projective transformation a right mapping? If not, is there any transformation good for that? Thanks, Yong Hu
4.testing whether a point is contained in a quadrilateral
Hi Everyone- In 2D or 3D, I'm trying to write a quick algorithm to test if a point is contatined in a quadrilateral. I've come up with a couple of ideas, but both of them seem needlessly complex. Does anyone know of a quick way to do this? Or maybe you know of a resource I should check out. Thanks in advance. -spencer
5.Forming An Equilateral Triangle About The Centre Of A Planar Quadrilateral
Given a planar quadrilateral, I want to form a equilateral triangle about the centre of the quadrilateral, such that this triangle is of maximum size while still being equilateral and completely within the area defined by the quadrilateral. Any thoughts on the best way of calculating such a triangle? Adam
6. Fitting a quadrilateral to pixels
7. Smallest 4-sided polygon surrounding convex hull ( smallest convex quadrilateral)
Users browsing this forum: No registered users and 39 guest