Archive for September, 2007

Page 362 OpenGL Super Bible! Figure 10-1 The (Free web hosting music)

Sunday, September 30th, 2007

Page 362 OpenGL Super Bible! Figure 10-1 The hex bolt to be modeled in this chapter Choosing a Projection Before we start constructing, we need a projection, a frame of reference for placing the objects. For an example like this, an orthogonal projection is the best choice. This is a typical choice for applications such as CAD, in which an object is being modeled and measured exactly. This bolt has a specific width, height, and number of threads and is comparatively small. Using a perspective projection would make sense if we were modeling something larger such as a landscape, where the effect would be more apparent. Listing 10-1 is the code that creates the viewing volume. It creates an orthogonal projection and represents a coordinate system that reaches 100 units along the x- and y-axis. An extra 100 units is supplied along the z-axis where the viewer will be located. Listing 10-1 Setting up the orthogonal projection for this chapter s examples // Change viewing volume and viewport. Called when window is resized void ChangeSize(GLsizei w, GLsizei h) { GLfloat nRange = 100.0f; // Prevent a divide by zero if(h == 0) h = 1; // Set Viewport to window dimensions glViewport(0, 0, w, h);
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

OpenGL Super Bible! Page 361 Chapter (Zeus web server) 10 3D

Saturday, September 29th, 2007

OpenGL Super Bible! Page 361 Chapter 10 3D Modeling and Object Composition What you ll learn in this chapter: How to Functions You ll Use Assemble polygons to create 3D objects glBegin/glEnd/glVertex Optimize object display with display lists glNewList/glEndList/glCallList Your quiver is quite full of OpenGL arrows by now and it s time to go hunting. Unlike previous chapters, this is going to be a project chapter, where you can put some of this stuff to practical use. We are going to define a problem or goal and pursue it to its logical end: a finished program. Along the way, you ll gain some insight in how to break your objects and scenes into smaller, more manageable pieces. We ll compose a complex object out of smaller, simpler objects, which in turn are composed of just the OpenGL primitives. As a finishing touch we ll show you why and how to apply display lists. One of the biggest reasons for using display lists is speed, so for the icing on the cake, we ll even give you a crude but effective means of benchmarking your code. Defining the Task To demonstrate building a figure out of smaller simpler figures, we will use an interesting, yet simple example that creates a model of a metallic bolt (like those holding your disk drive together). Although this particular bolt may not exist in any hardware store, it will have the essential features. We shall make the bolt as simple as possible while still retaining the flavor of our task. The bolt will have a six-sided head and a threaded shaft, like many typical steel bolts. Since this is a learning exercise, we ll simplify the threads by making them raised on the surface of the bolt shaft rather than carved out of the shaft. Figure 10-1 is a rough sketch of what we re aiming for. We will build the three major components of this bolt the head, the shaft, and the threads individually and then put them together to form the final object.
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Web domain - Page 360 OpenGL Super Bible! float v[3][3] =

Friday, September 28th, 2007

Page 360 OpenGL Super Bible! float v[3][3] = {{ 15.0f, 0.0f, 30.0f}, { 0.0f, 15.0f, 30.0f}, { 0.0f, 0.0f, 60.0f}}; // Calculate the normal for the plane calcNormal(v,normal); // Draw the triangle using the plane normal // for all the vertices glBegin(GL_TRIANGLES); glNormal3fv(normal); glVertex3fv(v[0]); glVertex3fv(v[1]); glVertex3fv(v[2]); glEnd(); See Also glTexCoord, glVertex
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.

Web design course - OpenGL Super Bible! Page 359 glNormal Purpose Defines

Thursday, September 27th, 2007

OpenGL Super Bible! Page 359 glNormal Purpose Defines a surface normal for the next vertex or set of vertices specified. Include File Variations void glNormal3b(GLbyte nx, GLbyte ny, GLbyte nz); void glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz); void glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz); void glNormal3i(GLint nx, GLint ny, GLint nz); void glNormal3s(GLshort nx, GLshort ny, GLshort nz); void glNormal3bv(const GLbyte *v); void glNormal3dv(const GLdouble *v); void glNormal3fv(const GLfloat *v); void glNormal3iv(const GLint *v); void glNormal3sv(const GLshort *v); Description The normal vector specifies which direction is up and perpendicular to the surface of the polygon. This is used for lighting and shading calculations. Specifying a unit vector of length 1 will improve rendering speed. OpenGL will automatically convert your normals to unit normals if you enable this with glEnable(GL_NORMALIZE); Parameters nx Specifies the x magnitude of the normal vector. ny Specifies the y magnitude of the normal vector. nz Specifies the z magnitude of the normal vector. Specifies an array of three elements containing the x, y, and z magnitudes of the normal vector. Returns None. Example The following code from the LITJET sample program from this chapter demonstrates setting a normal vector for each polygon before it is rendered. // Vertices for this panel float normal[3];
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

Page 358 (Yahoo free web hosting) OpenGL Super Bible! glMaterial Purpose Sets

Wednesday, September 26th, 2007

Page 358 OpenGL Super Bible! glMaterial Purpose Sets material parameters for use by the lighting model. Include File Variations void glMaterialf(GLenum face, GLenum pname, GLfloat param); void glMateriali(GLenum face,GLenum pname,GLint param); void glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) void glMaterialiv(GLenum face, GLenum pname, const GLint *params); Description This function is used to set the material reflectance properties of polygons. The GL_AMBIENT, GL_DIFFUSE, and GL_SPECULAR properties affect how these components of incident light are reflected. GL_EMISSION is used for materials that appear to give off their own light. GL_SHININESS can vary from 0 to 128, with the higher values producing a larger specular highlight on the material surface. Finally, GL_COLOR_INDEXES is used for material reflectance properties in color Index mode. Parameters face GLenum: Specifies whether the front, back, or both material properties of the polygons are being set by this function. May be either GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK. pname GLenum: For the first two variations, this specifies the single-valued material parameter being set. Currently, the only single-valued material parameter is GL_SHININESS. The second two variations, which take arrays for their parameters, may set the following material properties: GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_SHININESS, GL_AMBIENT_AND_DIFFUSE, or GL_COLOR_INDEXES. param GLfloat or GLint: Specifies the value to which the parameter specified by pname (GL_SHININESS) will be set. params GLfloat* or GLint*: An array of floats or integers that contain the components of the property being set. Returns None. Example See the LITJET sample program from this chapter. See Also glGetMaterial, glColorMaterial, glLight, glLightModel
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

OpenGL Super Bible! Page 357 value. For GL_LIGHT_MODEL_AMBIENT (Freelance web design)

Tuesday, September 25th, 2007

OpenGL Super Bible! Page 357 value. For GL_LIGHT_MODEL_AMBIENT this array points to four values that indicate the RGBA components of the ambient light. Returns None. Example The following code from this chapter s AMBIENT example sets up a global ambient light source consisting of a full-intensity white light. // Bright white light GLfloat ambientLight[] = { 1.0f, 1.0f, 1.0f, 1.0f }; glEnable(GL_DEPTH_TEST); // Hidden surface removal glEnable(GL_CULL_FACE); // Do not calculate inside of jet glFrontFace(GL_CCW); // Counterclockwise polygons face out // Enable lighting glEnable(GL_LIGHTING); // Set light model to use ambient light specified by ambientLight glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambientLight); See Also glLight, glMaterial
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.

Page 356 OpenGL Super Bible! glLightModel Purpose Sets

Thursday, September 20th, 2007

Page 356 OpenGL Super Bible! glLightModel Purpose Sets the lighting model parameters used by OpenGL. Include File Variations void glLightModelf(GLenum pname, GLfloat param) void glLightModeli(GLenum pname, GLint param); void glLightModelfv(GLenum pname, const GLfloat *params); void glLightModeliv(GLenum pname, const GLint *params); Description This function is used to set the lighting model parameters used by OpenGL. Any or all of three lighting model parameters may be set. GL_LIGHT_MODEL_AMBIENT is used to set a default ambient illumination for a scene. By default, this light has an RGBA value of (0.2, 0.2, 0.2, 1.0). Only the last two variations may be used to set this lighting model because they take pointers to an array that can contain the RGBA values. The GL_LIGHT_MODEL_TWO_SIDE parameter is specified to indicate whether both sides of polygons are illuminated. By default, only the front (defined by winding) of polygons is illuminated, using the front material properties as specified by glMaterial(). Finally, specifying a lighting model parameter of GL_LIGHT_MODEL_LOCAL_VIEWER modifies calculation of specular reflection angles, whether the view is down along the z axis or from the origin of the eye coordinate system (see Chapter 6). Parameters pname GLenum: Specifies a lighting model parameter. GL_LIGHT_MODEL_AMBIENT, GL_LIGHT_MODEL_LOCAL_VIEWER, and GL_LIGHT_MODEL_TWO_SIDE are accepted. param GLfloat or GLint: For GL_LIGHT_MODEL_LOCAL_VIEWER, a value of 0.0 indicates that specular lighting angles take the view direction to be parallel to and in the direction of the z axis. Any other value indicates that the view is from the origin of eye coordinate system. For GL_LIGHT_MODEL_TWO_SIDE, a value of 0.0 indicates that only the fronts of polygons are to be included in illumination calculations. Any other value indicates that both the front and back are included. This parameter has no effect on points, lines, or bitmaps. params GLfloat* or GLint*: For GL_LIGHT_MODEL_AMBIENT or GL_LIGHT_MODEL_LOCAL_VIEWER this points to an array of integers or floating point values, only the first element of which is used to set the parameter
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

OpenGL Super Bible! Page 355 The following code

Wednesday, September 19th, 2007

OpenGL Super Bible! Page 355 The following code from the LITJET example program sets up a single light source to the upper-left behind the viewer. The light source is composed only of moderate ambient and diffuse components. // Light values and coordinates GLfloat whiteLight[] = { 0.5f, 0.5f, 0.5f, 1.0f }; GLfloat lightPos[] = { -50.f, 50.0f, -100.0f, 0.0f }; // Enable lighting glEnable(GL_LIGHTING); // Set up and enable light 0 glLightfv(GL_LIGHT0,GL_AMBIENT_AND_DIFFUSE,whiteLight); glLightfv(GL_LIGHT0,GL_POSITION,lightPos); glEnable(GL_LIGHT0); See Also glGetLight
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Page 354 OpenGL Super Bible! (Web design online) glLight Purpose Sets

Tuesday, September 18th, 2007

Page 354 OpenGL Super Bible! glLight Purpose Sets light source parameters for one of the eight available light sources. Include File Variations void glLightf(GLenum light, GLenum pname, GLfloat param ); void glLighti(GLenum light, GLenum pname, GLint param ); void glLightfv(GLenum light, GLenum pname, const GLfloat *params ); void glLightiv(GLenum light, GLenum pname, const GLint *params ); Description Use this function to set the lighting parameters for one of the eight supported light sources. The first two variations of this function require only a single parameter value to set one of the following properties: GL_SPOT_EXPONENT, GL_SPOT_CUTOFF, GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, and GL_QUADRATIC_ATTENUATION. The second two variations are used for lighting parameters that require an array of multiple values. These include: GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_POSITION, and GL_SPOT_DIRECTION. These variations may also be used with single valued parameters by specifying a single element array for *params. Parameters light GLenum: Specifies which light source is being modified. This will range from 0 to GL_MAX_LIGHTS (8 for Windows NT and Windows 95). Constant light values are enumerated from GL_LIGHT0 to GL_LIGHT7. pname GLenum: Specifies which lighting parameter is being set by this function call. See Table 9-2 for a complete listing and the meaning of these parameters. param GLfloat, or GLint: For parameters that are specified by a single value, this specifies that value. These parameters are: GL_SPOT_EXPONENT, GL_SPOT_CUTOFF, GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, and GL_QUADRATIC_ATTENUATION. These parameters only have meaning for spot lights. params GLfloat*, or GLint*: An array of values that fully describe the parameters being set. See Table 9-2 for a listing and the meaning of these parameters. Returns None. Example
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

Web hosting top - OpenGL Super Bible! Page 353 glGetLightfv(GL_FRONT,GL_DIFFUSE,diffuseComp); glGetLightfv(GL_FRONT,GL_SPECULAR,specularComp); See

Monday, September 17th, 2007

OpenGL Super Bible! Page 353 glGetLightfv(GL_FRONT,GL_DIFFUSE,diffuseComp); glGetLightfv(GL_FRONT,GL_SPECULAR,specularComp); See Also glLight Table 9-2 Valid Lighting Parameters for glGetLight Property Meaning of Return Values GL_AMBIENT Four RGBA components. GL_DIFFUSE Four RGBA components. GL_SPECULAR Four RGBA components. GL_POSITION Four elements that specify the position of the light source. The first three elements specify the position of the light. The fourth, if 1.0, specifies that the light is at this position. Otherwise, the light source is directional and all rays are parallel. GL_SPOT_DIRECTION Three elements specifying the direction of the spotlight. This vector will not be normalized, and will be in eye coordinates. GL_SPOT_EXPONENT A single value representing the spot exponent. GL_SPOT_CUTOFF A single value representing the cutoff angle of the spot source. GL_CONSTANT_ATTENUATION A single value representing the constant attenuation of the light. GL_LINEAR_ATTENUATION A single value representing the linear attenuation of the light. GL_QUADRATIC_ATTENUATION A single value representing the quadratic attenuation of the light.
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.