So the strips are no good for sharp faced solids. Here's then a simple polygon rendering. gsngon=: 3 : '+. (_1^2%y)*^:(<y) 1' P=: gsngon 4 NB. regular planar polygon P0=: P,._1 P1=: P,. 1 Q=: _3]\, P0 (,.&}: ,. ,.~&}.) P1 NB. quads GS_AMBIENT=: 0.15 GS_DIFFUSE=: 0.7 GS_SPECULAR=: 0.7 GS_ROTXYZ=: 294 360 287 paint=: 3 : 0 gsinit GS_LIGHT gsdrawviewbox RED gsdrawpolygon P0;(gsnormal P0);RED gsdrawpolygon P1;(gsnormal P1);BLUE gscolor GREEN _4 (gsdrawpolygon@; '' ;~ gsnormal)\ Q gsfini'' )
----- Original Message ---- From: "Miller, Raul D" <[EMAIL PROTECTED]> To: Programming forum <[email protected]> Sent: Monday, July 31, 2006 11:29:56 AM Subject: RE: [Jprogramming] opengl geometry meshes? Oleg Kobchenko wrote: > It assigns the current normal to an added vertex, so > the normal specification can be reused for many > vertices, as in the for loop. But it does not relate > the normal to a face. So we have a problem in a strip > (or fan): vertices are shared between faces, but one > vertix can only have one normal, i.e. it will be correct > for only one face. It looks like the vertex normals, especially with the smooth shading model, are intended to represent normals on a smooth surface. For example, for a cube, the corresponding smooth surface might be a sphere, and the vertex normals should be normal to the sphere. Alternatively, if you want sharp edges or corners, the vertices should not be shared between faces where the geometry is not supposed to be smooth. (Coordinates should be shared, but not vertices.) There has been some work on applying smoothing not only to shading but to geometry (google: "n patches"), but as near as I can tell support for this concept has not been adopted into any standard. (Also, it's not clear to me what the underlying geometric model is -- for example, would a cube whose geometry is smoothed using n-patches look like a sphere?) -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
