Just to weigh in on this subject with an additional piece of information. The exact mapping of texels to pixels is driver dependnant. DirectX maps texture coordinates to pixels by looking at the coordinate values stradelling the pixel boundary, while OpenGL looks at the texture coordinates which are exactly on the pixel. This generally has no relevance unless you are doing image plate aligned work like volumetric fog or overlays.
-----Original Message----- From: Wolfgang Kienreich [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 05, 2002 3:09 AM To: [EMAIL PROTECTED] Subject: [JAVA3D] AW: [JAVA3D] FW: [JAVA3D] Texturing (tiling) Hi Zak, >Question: > >Whenever I am texturing an object, is the texture confined to the scale of >0.0 to 1.0 ? >I create a texture and place it in the tile, yet the image seems compressed. >Is there anyway to resolve this? > > >-Zak Some aspects on this ... * Physically, your image has a size in pixel, e.g. 256x256, and coordinates for the center would be given as (128,128). For texturing, you refer to image coordinates in a normalized form, the center being (0.5,0.5) and the size being (1.0,1.0) - always, regardless of physical image size. * The vertices of a polygon get assigned texture coordinates, which are given in the texture coordinate system described above. For a quadrangle, no matter what size or orientation, to have a texture exactly cover it, texture coordinates would have to be (0,0)-(1,0)-(1,1)-(0,1) or so. * However, you can assign coordinates other than that. For example you could assign a vertex texture coordinates of (10,10). Then, one of two things can happen: (1) The texture can be repeated (tiled), in this case 10 by 10 times, across the surface. Or, (2) The texture can be clamped to (0,1), the outside area being filled with something else. You decide what happens using the following settings within the Texture class: (cite from J3D docs) setBoundaryModeS / setBoundaryModeT CLAMP - clamps texture coordinates to be in the range [0,1]. Texture boundary texels or the constant boundary color if boundary width is 0 will be used for values that fall outside this range. WRAP - repeats the texture by wrapping texture coordinates that are outside the range [0,1]. Only the fractional portion of the texture coordinates is used. The integer portion is discarded (end of cite) * Finally, why should an image seem compressed? Two possiblities here: (1) The polygon which you are texturing does not feature the same aspect ratio as your image. E.g., a quadratic image will only look "uncompressed" on a quadrangle. (2) You have wrong texture coordinates of some kind. Hope this helps Wolfgang =================================================== Wolfgang Kienreich Knowledge Retrieval/Knowledge Visualization Know-Center Inffeldgasse 16c, 8010 Graz, Austria Email : [EMAIL PROTECTED] Tel: +43 316 820918 843 Fax: +43 316 873 5688 The program for I-KNOW '02 is now available at http://www.i-know.at =================================================== =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
