graphics

### Next

• 1. OT: 3D - data import/export lib
Hi, it might be a little bit OT here, but i think here the profis to handle this. Im searching for a lib/ocx/... to import/export 3D-data (meshes/polygons). The import should handle minimum: - 3DS - DXF/DWG - .... Does anyone know such a produkt ? Thanks, Howie
• 2. How to draw a smooth hill from a set of contours
Given a set of contours with polygon and height ,how to get a better look hill from these data
• 3. normal mapping polygon models
Hi, I have a question about computing the tangent space frame for normal mapping. I am talking about polygonal modeling here. The CG Tutorial discusses some way of parameterizing a 3D triangle in terms of the texture coordinates (s, t). Then it takes the partial derivatives with respect to s and t to get two tangents. I'm wondering though, why not just use the 3 triangle points to compute the plane equation: Ax + By + Cz + D = 0 Then get the height of the plane as a function of x, z: y = -A/B x - C/B z - D Then take the partial derivatives of y(x, z) with respect to x and z: y_x = -A/B y_z = -C/B Two tangent vectors: (1, -A/B, 0) (0, -C/B, 1) This result seems reasonable--the slopes should be constant since it's a plane. Am I wrong? Can I use this method instead of the CG Tutorials? Or is there some reason why you want to parameterize with respect to the texture coordinates? It seems both methods should equally work since you just want a tangent frame at a point on the surface to describe your sampled normal from the normal map relative to.
• 4. antialias with HDR
Hello everybody I have a scene with a simple perfect black box, and behind it a very very bright background. I took 100 samples, and just on that pixel, 50% of samples hit the light, and the rest, the black box. The bright area has an intensity of 10000, and the black box has an intensity of 0. 10000 * 50 + 0 * 50 = 50000 / 100 samples = 500 average pixel intensity The next pixel is 100% covered by the black box, so, the pixel is pure black. Now I store the result picture on a rectangular buffer. I loose all the sampling information. After all the rendering is done, I apply a simple tonemapping algorithm to the whole picture, for example, clamping all the values outside the 0..1 range. Now I display the image, and I get a complete aliased black box with a white background. How can I deal with this situation? In which part of the render pipeline should I apply an antialias algorithm?

```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.
```

```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
```

```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);
/* 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);
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;
}
```

```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 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.

```

```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

Any thoughts on the best way of calculating such a triangle?