⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fgltexgen.html

📁 计算机图形学~想必是很多人需要的~在此共享一下
💻 HTML
字号:
<HTML><BODY><PRE>     <STRONG>NAME</STRONG>	  <STRONG>fglTexGend,</STRONG> <STRONG>fglTexGenf,</STRONG> <STRONG>fglTexGeni,</STRONG> <STRONG>fglTexGendv,</STRONG>	  <STRONG>fglTexGenfv,</STRONG> <STRONG>fglTexGeniv</STRONG> - control the generation of texture	  coordinates     <STRONG>FORTRAN</STRONG> <STRONG>SPECIFICATION</STRONG>	  SUBROUTINE <STRONG>fglTexGend</STRONG>( INTEGER*4 <EM>coord</EM>,				 INTEGER*4 <EM>pname</EM>,				 REAL*8	<EM>param</EM> )	  SUBROUTINE <STRONG>fglTexGenf</STRONG>( INTEGER*4 <EM>coord</EM>,				 INTEGER*4 <EM>pname</EM>,				 REAL*4	<EM>param</EM> )	  SUBROUTINE <STRONG>fglTexGeni</STRONG>( INTEGER*4 <EM>coord</EM>,				 INTEGER*4 <EM>pname</EM>,				 INTEGER*4 <EM>param</EM> )     <STRONG>PARAMETERS</STRONG>	  <EM>coord</EM>	  Specifies a texture coordinate.  Must	be one of		  <STRONG>GL_S</STRONG>,	<STRONG>GL_T</STRONG>, <STRONG>GL_R</STRONG>, or <STRONG>GL_Q</STRONG>.	  <EM>pname</EM>	  Specifies the	symbolic name of the texture-		  coordinate generation	function.  Must	be		  <STRONG>GL_TEXTURE_GEN_MODE</STRONG>.	  <EM>param</EM>	  Specifies a single-valued texture generation		  parameter, one of <STRONG>GL_OBJECT_LINEAR</STRONG>, <STRONG>GL_EYE_LINEAR</STRONG>,		  or <STRONG>GL_SPHERE_MAP</STRONG>.     <STRONG>FORTRAN</STRONG> <STRONG>SPECIFICATION</STRONG>	  SUBROUTINE <STRONG>fglTexGendv</STRONG>( INTEGER*4 <EM>coord</EM>,				  INTEGER*4 <EM>pname</EM>,				  CHARACTER*8 <EM>params</EM> )	  SUBROUTINE <STRONG>fglTexGenfv</STRONG>( INTEGER*4 <EM>coord</EM>,				  INTEGER*4 <EM>pname</EM>,				  CHARACTER*8 <EM>params</EM> )	  SUBROUTINE <STRONG>fglTexGeniv</STRONG>( INTEGER*4 <EM>coord</EM>,				  INTEGER*4 <EM>pname</EM>,				  CHARACTER*8 <EM>params</EM> )     <STRONG>PARAMETERS</STRONG>	  <EM>coord</EM>	       Specifies a texture coordinate.	Must be	one of <STRONG>GL_S</STRONG>,	       <STRONG>GL_T</STRONG>, <STRONG>GL_R</STRONG>, or <STRONG>GL_Q</STRONG>.	  <EM>pname</EM>	       Specifies the symbolic name of the texture-coordinate	       generation function or function parameters.  Must be	       <STRONG>GL_TEXTURE_GEN_MODE</STRONG>, <STRONG>GL_OBJECT_PLANE</STRONG>, or	<STRONG>GL_EYE_PLANE</STRONG>.	  <EM>params</EM>	       Specifies a pointer to an array of texture generation	       parameters.  If <EM>pname</EM> is	<STRONG>GL_TEXTURE_GEN_MODE</STRONG>, then the	       array must contain a single symbolic constant, one of	       <STRONG>GL_OBJECT_LINEAR</STRONG>, <STRONG>GL_EYE_LINEAR</STRONG>,	or <STRONG>GL_SPHERE_MAP</STRONG>.	       Otherwise, <EM>params</EM> holds the coefficients	for the	       texture-coordinate generation function specified	by	       <EM>pname</EM>.     <STRONG>DESCRIPTION</STRONG>	  <STRONG>fglTexGen</STRONG> selects a texture-coordinate generation function	  or supplies coefficients for one of the functions.  <EM>coord</EM>	  names	one of the (<EM>s</EM>, <EM>t</EM>, <EM>r</EM>, <EM>q</EM>)	texture	coordinates; it	must	  be one of the	symbols	<STRONG>GL_S</STRONG>, <STRONG>GL_T</STRONG>, <STRONG>GL_R</STRONG>, or <STRONG>GL_Q</STRONG>.  <EM>pname</EM> must	  be one of three symbolic constants:  <STRONG>GL_TEXTURE_GEN_MODE</STRONG>,	  <STRONG>GL_OBJECT_PLANE</STRONG>, or <STRONG>GL_EYE_PLANE</STRONG>. If <EM>pname</EM> is	  <STRONG>GL_TEXTURE_GEN_MODE</STRONG>, then <EM>params</EM> chooses a mode, one of	  <STRONG>GL_OBJECT_LINEAR</STRONG>, <STRONG>GL_EYE_LINEAR</STRONG>, or <STRONG>GL_SPHERE_MAP</STRONG>. If	<EM>pname</EM>	  is either <STRONG>GL_OBJECT_PLANE</STRONG> or <STRONG>GL_EYE_PLANE</STRONG>, <EM>params</EM> contains	  coefficients for the corresponding texture generation	  function.	  If the texture generation function is	<STRONG>GL_OBJECT_LINEAR</STRONG>, the	  function			     g=p x +p y	+p z +p	w				1 o  2 o  3 o  4 o	  is used, where g is the value	computed for the coordinate	  named	in <EM>coord</EM>, p , p	, p , and p  are the four values	  supplied in <EM>param</EM><STRONG><</STRONG>EM>s</EM>, a<STRONG>n</STRONG>d x3, y	, z4, and w  are the object	  coordinates of the vertex<STRONG>.</STRONG>  T<STRONG>h</STRONG>is <STRONG>f</STRONG>unctionocan	be used, for	  example, to texture-map terrain using	sea level as a	  reference plane (defined by p	, p , p	, and p	). The	  altitude of a	terrain	vertex <STRONG>i</STRONG>s c<STRONG>o</STRONG>mpu<STRONG>t</STRONG>ed by t<STRONG>h</STRONG>e	  <STRONG>GL_OBJECT_LINEAR</STRONG> coordinate generation function as its	  distance from	sea level; that	altitude can then be used to	  index	the texture image to map white snow onto peaks and	  green	grass onto foothills.	  If the texture generation function is	<STRONG>GL_EYE_LINEAR</STRONG>, the	  function			 g=p ' x +p ' y	+p ' z +p ' w			    1	e  2   e  3   e	 4   e	  is used, where		   (p '	 p '  p	'  p ')=(p   p	 p   p ) M-1		     1	  2    3    4	  1   2	  3   4	  and x	, y , z	, and w	 are the eye coordinates of the	  verte<STRONG>x</STRONG>, pe, pe, p , a<STRONG>n</STRONG>d p  are the values supplied in	  <EM>params</EM>, a<STRONG>n</STRONG>d M2is <STRONG>t</STRONG>he mode<STRONG>l</STRONG>view matrix	when <STRONG>fglTexGen</STRONG> is	  invoked.  If M is poorly conditioned or singular, texture	  coordinates generated	by the resulting function may be	  inaccurate or	undefined.	  Note that the	values in <EM>params</EM> define	a reference plane in	  eye coordinates. The modelview matrix	that is	applied	to	  them may not be the same one in effect when the polygon	  vertices are transformed. This function establishes a	field	  of texture coordinates that can produce dynamic contour	  lines	on moving objects.	  If <EM>pname</EM> is <STRONG>GL_SPHERE_MAP</STRONG> and	<EM>coord</EM> is either	<STRONG>GL_S</STRONG> or	<STRONG>GL_T</STRONG>,	  s and	t texture coordinates are generated as follows.	Let <EM>u</EM>	  be the unit vector pointing from the origin to the polygon	  vertex (in eye coordinates). Let <EM>n</EM> sup prime be the current	  normal, after	transformation to eye coordinates. Let			       f = (f	f   f )T	  be the reflection vector su<STRONG>c</STRONG>h	t<STRONG>h</STRONG>at z					  ' 'T				f = u -	2n n  u			      _______________	  Finally, let m = 2 |f	2+f 2+(f +1)2. Then the	values	  assigned to the s <STRONG>an</STRONG>dxt t<STRONG>e</STRONG>xtur<STRONG>e</STRONG> coordinates are				       <STRONG>__</STRONG>   <STRONG>_</STRONG>				   s = m  + 2				       f				   t = _<STRONG>_</STRONG> + <STRONG>_</STRONG>				       m    2	  To enable or disable a texture-coordinate generation	  function, call <STRONG>fglEnable</STRONG> or <STRONG>fglDisable</STRONG> with one of the	  symbolic texture-coordinate names (<STRONG>GL_TEXTURE_GEN_S</STRONG>,	  <STRONG>GL_TEXTURE_GEN_T</STRONG>, <STRONG>GL_TEXTURE_GEN_R</STRONG>, or <STRONG>GL_TEXTURE_GEN_Q</STRONG>) as	  the argument.	When enabled, the specified texture coordinate	  is computed according	to the generating function associated	  with that coordinate.	When disabled, subsequent vertices	  take the specified texture coordinate	from the current set	  of texture coordinates. Initially, all texture generation	  functions are	set to <STRONG>GL_EYE_LINEAR</STRONG> and are disabled.	Both s	  plane	equations are (1, 0, 0,	0), both t plane equations are	  (0, 1, 0, 0),	and all	r and q	plane equations	are (0,	0, 0,	  0).     <STRONG>ERRORS</STRONG>	  <STRONG>GL_INVALID_ENUM</STRONG> is generated when <EM>coord</EM> or <EM>pname</EM> is not an	  accepted defined value, or when <EM>pname</EM>	is <STRONG>GL_TEXTURE_GEN_MODE</STRONG>	  and <EM>params</EM> is	not an accepted	defined	value.	  <STRONG>GL_INVALID_ENUM</STRONG> is generated when <EM>pname</EM> is	  <STRONG>GL_TEXTURE_GEN_MODE</STRONG>, <EM>params</EM> is <STRONG>GL_SPHERE_MAP</STRONG>,	and <EM>coord</EM> is	  either <STRONG>GL_R</STRONG> or <STRONG>GL_Q</STRONG>.	  <STRONG>GL_INVALID_OPERATION</STRONG> is generated if <STRONG>fglTexGen</STRONG> is executed	  between the execution	of <STRONG>fglBegin</STRONG> and	the corresponding	  execution of <STRONG>fglEnd</STRONG>.     <STRONG>ASSOCIATED</STRONG>	<STRONG>GETS</STRONG>	  <STRONG>fglGetTexGen</STRONG>	  <STRONG>fglIsEnabled</STRONG> with argument <STRONG>GL_TEXTURE_GEN_S</STRONG>	  <STRONG>fglIsEnabled</STRONG> with argument <STRONG>GL_TEXTURE_GEN_T</STRONG>	  <STRONG>fglIsEnabled</STRONG> with argument <STRONG>GL_TEXTURE_GEN_R</STRONG>	  <STRONG>fglIsEnabled</STRONG> with argument <STRONG>GL_TEXTURE_GEN_Q</STRONG>     <STRONG>SEE</STRONG> <STRONG>ALSO</STRONG>	  <STRONG>fglCopyPixels</STRONG>, <STRONG>fglCopyTexImage2D</STRONG>, <STRONG>fglCopyTexSubImage1D</STRONG>,	  <STRONG>fglCopyTexSubImage2D</STRONG>,	<STRONG>fglTexEnv</STRONG>, <STRONG>fglTexImage1D</STRONG>,	  <STRONG>fglTexImage2D</STRONG>, <STRONG>fglTexParameter</STRONG>, <STRONG>fglTexSubImage1D</STRONG>,	  <STRONG>fglTexSubImage2D</STRONG></PRE></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -