15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    SGIX_polynomial_ffd
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_SGIX_polynomial_ffd
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciVersion
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    $Date: 1996/03/01 22:13:06 $ $Revision: 1.15 $
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNumber
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    59
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciDependencies
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    None
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciOverview
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    This extension adds the capability to alter vertex coordinates,  the
245bd8deadSopenharmony_ci    corresponding normal coordinates, and texture coordinates based on a
255bd8deadSopenharmony_ci    client-specified trivariate polynomial functions.  These functions may be
265bd8deadSopenharmony_ci    thought of as a warping of object/texture space (or, alternatively, as a
275bd8deadSopenharmony_ci    warping of the object embedded in object/texture space).
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    Deformations of space are used for a variety of modeling effects, including
305bd8deadSopenharmony_ci    character animation.  The deformation specified in this extension is one of
315bd8deadSopenharmony_ci    a variety of mappings that have been proposed.
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    Only 3D to 3D deformation are considered.   We shall not consider
345bd8deadSopenharmony_ci    homogeneous deformations.
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ciIssues
375bd8deadSopenharmony_ci    * Mark: Should there also be a 'target' parameter to allow for multiple
385bd8deadSopenharmony_ci      (cumulative) deformations in the future?  (If yes, we need a new
395bd8deadSopenharmony_ci      'get'.)
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci      Ziv: I think we can get away by 'naming' additional deformations as
425bd8deadSopenharmony_ci      {GEOMETRY/TEXTURE}_DEFORMATION_XXX_SGIX and still use GetMap.
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    * Mark: Limited memory may make it problematic to use both high-order
455bd8deadSopenharmony_ci      evaluators and deformations at the same time.  The available memory could
465bd8deadSopenharmony_ci      be traded off between deformations and evaluators (uh-oh --- do I smell an
475bd8deadSopenharmony_ci      'evaluator object' extension coming?).
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci      Ziv: The RESOURCE_UNAVAILABLE error mechanism could solves this problem.
505bd8deadSopenharmony_ci      Too bad it was reject from 1.1.  I am not clear about how we introduce it
515bd8deadSopenharmony_ci      into an extension without having another extension.
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    * Mark: Should deformations of texture, normal, and color coordinates be
545bd8deadSopenharmony_ci      included as well.
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci      Ziv: As we already define normal deformations to be derived from the
575bd8deadSopenharmony_ci      geometry deformation, independent normal deformations should not be
585bd8deadSopenharmony_ci      included.  We do need Texture deformation however (e.g., for 3D
595bd8deadSopenharmony_ci      textures), as texture and object space are different and are
605bd8deadSopenharmony_ci      included. Color, being a non geometric entity does not seem to belong
615bd8deadSopenharmony_ci      here.
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ci    * Ziv: spec order issue.  The natural specification of deformations is in
645bd8deadSopenharmony_ci      the Coordinate Transformations section - 2.9.  However, deformation use
655bd8deadSopenharmony_ci      the description of Bernstein polynomials in evaluator section - 5.1 -
665bd8deadSopenharmony_ci      creating an awkward forward reference.   In a formal spec the description
675bd8deadSopenharmony_ci      of the polynomial would have to move from evaluators to the deformations
685bd8deadSopenharmony_ci      sub-section.
695bd8deadSopenharmony_ci      
705bd8deadSopenharmony_ciNew Procedures and Functions
715bd8deadSopenharmony_ci
725bd8deadSopenharmony_ci    void DeformationMap3{fd}SGIX( enum target,
735bd8deadSopenharmony_ci				  T u1, T u2, int ustride, int uorder,
745bd8deadSopenharmony_ci				  T v1, T v2, int vstride, int vorder,
755bd8deadSopenharmony_ci				  T w1, T w2, int wstride, int worder,
765bd8deadSopenharmony_ci				  T* points);
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci    void LoadIdentityDeformationMapSGIX( bitfield mask );
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci    void DeformSGIX( bitfield mask );
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ciNew Tokens
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ci    Accepted by the <target> parameter of DeformationMap3[fd]SGIX, and by the
855bd8deadSopenharmony_ci    <target> parameter of GetMap:
865bd8deadSopenharmony_ci    
875bd8deadSopenharmony_ci        GEOMETRY_DEFORMATION_SGIX
885bd8deadSopenharmony_ci        TEXTURE_DEFORMATION_SGIX
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ci    Accepted by the <mask> parameter of DeformSGIX, and
915bd8deadSopenharmony_ci    LoadIdentityDeformationMapSGIX:
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci        TEXTURE_DEFORMATION_BIT_SGIX		0x1
945bd8deadSopenharmony_ci    	GEOMETRY_DEFORMATION_BIT_SGIX 		0x2
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
975bd8deadSopenharmony_ci    GetFloatv, and GetDoublev:
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci    	DEFORMATIONS_MASK_SGIX
1005bd8deadSopenharmony_ci    	MAX_DEFORMATION_ORDER_SGIX
1015bd8deadSopenharmony_ci	
1025bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci    Section 2.6.3, "GL Commands within Begin/End", is changed to include
1055bd8deadSopenharmony_ci    DeformSGIX in the list of commands allowed within Begin/End.
1065bd8deadSopenharmony_ci    
1075bd8deadSopenharmony_ci    The second paragraph of 2.9, "Coordinate Transformations," is replaced by
1085bd8deadSopenharmony_ci    (where Figure 2.6 is modified accordingly):
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    Figure 2.6 diagrams the sequence of transformations that are applied to
1115bd8deadSopenharmony_ci    vertices.  The vertex coordinates that are presented to the GL are termed
1125bd8deadSopenharmony_ci    object coordinates.  The enabled geometry deformations (deformations are
1135bd8deadSopenharmony_ci    described in sub-section XXX, "Deformations") are applied to these
1145bd8deadSopenharmony_ci    coordinates to yield deformed object coordinates.  When no deformations are
1155bd8deadSopenharmony_ci    enabled it is as if an identity deformation is applied to the object
1165bd8deadSopenharmony_ci    coordinates.  Unless explicitly stated otherwise, in the rest of this
1175bd8deadSopenharmony_ci    document we will refer to deformed object coordinates as just object
1185bd8deadSopenharmony_ci    coordinates.  The model-view matrix is then applied to the object
1195bd8deadSopenharmony_ci    coordinates to yield eye coordinates.  Then another matrix, called the
1205bd8deadSopenharmony_ci    projection matrix, is applied to eye coordinates to yield clip coordinates.
1215bd8deadSopenharmony_ci    A perspective division is carried out on clip coordinates to yield
1225bd8deadSopenharmony_ci    normalized device coordinates.  A final viewport transformation is applied
1235bd8deadSopenharmony_ci    to convert these coordinates into window coordinates.
1245bd8deadSopenharmony_ci
1255bd8deadSopenharmony_ci    A new sub-section entitled 'Deformations' is added after section 2.9.1:
1265bd8deadSopenharmony_ci    
1275bd8deadSopenharmony_ci    Deformations provide a means to use a polynomial mapping to transform
1285bd8deadSopenharmony_ci    vertex, normal, and texture coordinates.  When a deformation is applied to a
1295bd8deadSopenharmony_ci    4-tuple (c_0,c_1,c_2,c_3) the 3-tuple (c_0,c_1,c2) is transformed by a
1305bd8deadSopenharmony_ci    trivariate deformation map to another 3-tuple, while the c_3 remains
1315bd8deadSopenharmony_ci    unchanged.  The mapping of normals is not independent of the vertex mapping
1325bd8deadSopenharmony_ci    but is rather derived from the vertex deformation map.
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci    Let sum_{i=0}^l represent the sum over i from 0 to l.
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    Consider the R^3-valued function:
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci    p(u,v,w)
1395bd8deadSopenharmony_ci      = sum_{i=0}^l sum_{j=0}^m sum_{k=0}^n B_i^l(u) B_j^m(v) B_k^n(w) R_ijk
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci    where B_i^j is a Bernstein polynomial as defined in equation 5.1.  The R_ijk
1425bd8deadSopenharmony_ci    are control points (as in equation 5.1); they correspond to the <points>
1435bd8deadSopenharmony_ci    specified with the DeformationMap3[fd]SGIX command.  <target> is one of the
1445bd8deadSopenharmony_ci    symbolic constants GEOMETRY_DEFORMATION_SGIX or TEXTURE_DEFORMATION_SGIX.
1455bd8deadSopenharmony_ci    <points> is a pointer to (l+1)(m+1)(n+1) blocks of storage (<uorder> = l+1,
1465bd8deadSopenharmony_ci    <vorder> = m+1, and <worder> = n+1).  The error INVALID_VALUE is generated
1475bd8deadSopenharmony_ci    if any of <uorder>, <vorder>, or <worder> is less than one, or if their
1485bd8deadSopenharmony_ci    product is greater than MAX_DEFORMATION_ORDER.  The three values comprising
1495bd8deadSopenharmony_ci    R_ijk are located at
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci	 <ustride>i + <vstride>j + <wstride>k
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    values (either single- or double-precision floating-point, as appropriate)
1545bd8deadSopenharmony_ci    past the first value pointed to by <points>.
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci    <u1>, <u2>, <v1>, <v2>, <w1>, and <w2> define the pre-image of the
1575bd8deadSopenharmony_ci    the map; a domain point (u', v', w') is evaluated as
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ci			  u' - <u1>    v' - <v1>    w' - <w1>
1605bd8deadSopenharmony_ci	p'(u',v',w') = p( -----------, -----------, -----------)
1615bd8deadSopenharmony_ci			  <u2> - <u1>  <v2> - <v1>  <w2> - <w1>
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if any of <ustride>, <vstride>, or
1645bd8deadSopenharmony_ci    <wstride> is less than 3, or if <u1> is equal to <u2>, <v1> is equal to
1655bd8deadSopenharmony_ci    <v2>, or if <w1> is equal to <w2>.
1665bd8deadSopenharmony_ci
1675bd8deadSopenharmony_ci    Deformations are enabled and disabled using Deform.  The <mask> parameter is
1685bd8deadSopenharmony_ci    a bitwise OR of symbolic constants indicating which deformations are to be
1695bd8deadSopenharmony_ci    enabled.  The symbolic constants GEOMETRY_DEFORMATION_BIT_SGIX and
1705bd8deadSopenharmony_ci    TEXTURE_DEFORMATION_BIT_SGIX correspond to the geometry and texture
1715bd8deadSopenharmony_ci    deformations, respectively.  When a bit corresponding to a given deformation
1725bd8deadSopenharmony_ci    is 0, that deformation will be disabled.  The error INVALID_VALUE
1735bd8deadSopenharmony_ci    is generated if the <mask> contains bits other than
1745bd8deadSopenharmony_ci    GEOMETRY_DEFORMATION_BIT_SGIX and TEXTURE_DEFORMATION_BIT_SGIX.
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ci    When enabled, geometry deformation maps (currently only one geometry
1775bd8deadSopenharmony_ci    deformation - GEOMETRY_DEFORMATION_SGIX - is defined) are applied to vertex
1785bd8deadSopenharmony_ci    coordinates immediately before the application of the model-view matrix.
1795bd8deadSopenharmony_ci    When a map is applied to a vertex the normal that is associated with that
1805bd8deadSopenharmony_ci    vertex is transformed as described below.  Enabled texture deformation maps
1815bd8deadSopenharmony_ci    (current only one texture deformation - TEXTURE_DEFORMATION_SGIX is defined)
1825bd8deadSopenharmony_ci    are applied to texture coordinates immediately prior to the application of
1835bd8deadSopenharmony_ci    the texture matrix.
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    Normal coordinates are transformed by each enabled geometry deformation.
1865bd8deadSopenharmony_ci    The transformation proceeds by first computing the partial Jacobian matrix
1875bd8deadSopenharmony_ci    J of p' at the point (u', v', w'):
1885bd8deadSopenharmony_ci
1895bd8deadSopenharmony_ci	J = ( dp'/du' dp'/dv' dp'/dw' )
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci    (p' is a column of 3 values, so dp'/ds is also).
1925bd8deadSopenharmony_ci    The transformed normal, n', is found from the untransformed normal,
1935bd8deadSopenharmony_ci    n = ( nx ny nz ), as
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci	n' = n J^{-1}.
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci    Note, that as deformations are defined to be applied immediately before the
1985bd8deadSopenharmony_ci    application model-view and texture matrices, they are therefore also applied
1995bd8deadSopenharmony_ci    to the vertices, normals, and textures resulting from EvalCoord and EvalMesh
2005bd8deadSopenharmony_ci    commands.
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ci    LoadIdentityDeformation provides a quick method for setting
2035bd8deadSopenharmony_ci    deformations to the identity deformation.  The map for the
2045bd8deadSopenharmony_ci    deformations indicated by the <mask> parameter (with the same
2055bd8deadSopenharmony_ci    interpretation as in Deform) are set to the identity map.  The
2065bd8deadSopenharmony_ci    identity deformation maps are order 2 in each of u, v, and w, with
2075bd8deadSopenharmony_ci    <u1>=<v1>=<w1>=0 and <u2>=<v2>=<w2>=1, and the control point being
2085bd8deadSopenharmony_ci    (0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (1, 0, 0), (1, 0, 1),
2095bd8deadSopenharmony_ci    (1, 1, 0), and (1, 1, 1).
2105bd8deadSopenharmony_ci    Note,  that unlike Deform, it is not an error for the mask to contain
2115bd8deadSopenharmony_ci    bits other than than GEOMETRY_DEFORMATION_BIT_SGIX and
2125bd8deadSopenharmony_ci    TEXTURE_DEFORMATION_BIT_SGIX.
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ci    The state required for deformations is 2 3-dimensional map specification (as
2155bd8deadSopenharmony_ci    described by the call to DeformMap[fd]SGIX) and a bit mask indicating
2165bd8deadSopenharmony_ci    currently enabled deformations.  The maximum possible value for
2175bd8deadSopenharmony_ci    the product of <uorder>, <vorder>, and <worder> for each deformation type is
2185bd8deadSopenharmony_ci    implementation dependent but must be at least 1.  Initially, all the
2195bd8deadSopenharmony_ci    deformation maps are the identity map.
2205bd8deadSopenharmony_ci
2215bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.0 Specification (Rasterization)
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci    None
2245bd8deadSopenharmony_ci
2255bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
2265bd8deadSopenharmony_ciand the Framebuffer)
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ci    None
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.0 Specification (Special Functions)
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci    None
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.0 Specification (State and State Requests)
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ci    None
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ciGLX Protocol
2395bd8deadSopenharmony_ci	
2405bd8deadSopenharmony_ci    XXX - Not figured out yet.
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ciDependencies on other extensions
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci    None
2455bd8deadSopenharmony_ci
2465bd8deadSopenharmony_ciErrors
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if the DeformationMap3[fd]SGIX <target>
2495bd8deadSopenharmony_ci    parameter is not GEOMETRY_DEFORMATION_SGIX or TEXTURE_DEFORMATION_SGIX.
2505bd8deadSopenharmony_ci
2515bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by DeformationMap3[fd]SGIX if:
2525bd8deadSopenharmony_ci	- any of <uorder>, <vorder>, or <worder> is less than one, or if their
2535bd8deadSopenharmony_ci	  product is greater than MAX_DEFORMATION_ORDER;
2545bd8deadSopenharmony_ci	- any of <ustride>, <vstride>, or <wstride> is less than 3;
2555bd8deadSopenharmony_ci	- <u1> is equal to <u2>, <v1> is equal to <v2>, or <w1> is equal
2565bd8deadSopenharmony_ci	  to <w2>. 
2575bd8deadSopenharmony_ci    
2585bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by DeformSGIX if the <mask>
2595bd8deadSopenharmony_ci    contains bits other than GEOMETRY_DEFORMATION_BIT_SGIX and
2605bd8deadSopenharmony_ci    TEXTURE_DEFORMATION_BIT_SGIX.
2615bd8deadSopenharmony_ci
2625bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if DeformationMap3[fd]SGIX is
2635bd8deadSopenharmony_ci    executed between execution of Begin and the corresponding execution of End.
2645bd8deadSopenharmony_ci
2655bd8deadSopenharmony_ciNew State
2665bd8deadSopenharmony_ci
2675bd8deadSopenharmony_ci    Initial			Initial
2685bd8deadSopenharmony_ci    Get Value			Get Command	Type	  		Value 		Attrib
2695bd8deadSopenharmony_ci    ---------			-----------	----	  		-------		------
2705bd8deadSopenharmony_ci    ORDER			GetMap		2 x 3 x Z_1*		1,1,1		  -
2715bd8deadSopenharmony_ci    COEFF			GetMap		2 x 1* x 1* x 1* x R3	Sec X(2.9.1+)	  -
2725bd8deadSopenharmony_ci    DOMAIN			GetMap		2 x 6 x R		Sec X(2.9.1+)	  -
2735bd8deadSopenharmony_ci    DEFORMATION_MASK		GetIntegerv	F			0		transform
2745bd8deadSopenharmony_ci
2755bd8deadSopenharmony_ci    - F is a new state variable type: a bitfield mask of flags.
2765bd8deadSopenharmony_ci    
2775bd8deadSopenharmony_ciNew Implementation Dependent State
2785bd8deadSopenharmony_ci									Minimum
2795bd8deadSopenharmony_ci    Get Value				Get Command	Type		Value
2805bd8deadSopenharmony_ci    ---------				-----------	----		-------
2815bd8deadSopenharmony_ci    MAX_DEFORMATION_ORDER		GetInteger       Z                2
2825bd8deadSopenharmony_ci
283