1Name 2 3 SGIX_polynomial_ffd 4 5Name Strings 6 7 GL_SGIX_polynomial_ffd 8 9Version 10 11 $Date: 1996/03/01 22:13:06 $ $Revision: 1.15 $ 12 13Number 14 15 59 16 17Dependencies 18 19 None 20 21Overview 22 23 This extension adds the capability to alter vertex coordinates, the 24 corresponding normal coordinates, and texture coordinates based on a 25 client-specified trivariate polynomial functions. These functions may be 26 thought of as a warping of object/texture space (or, alternatively, as a 27 warping of the object embedded in object/texture space). 28 29 Deformations of space are used for a variety of modeling effects, including 30 character animation. The deformation specified in this extension is one of 31 a variety of mappings that have been proposed. 32 33 Only 3D to 3D deformation are considered. We shall not consider 34 homogeneous deformations. 35 36Issues 37 * Mark: Should there also be a 'target' parameter to allow for multiple 38 (cumulative) deformations in the future? (If yes, we need a new 39 'get'.) 40 41 Ziv: I think we can get away by 'naming' additional deformations as 42 {GEOMETRY/TEXTURE}_DEFORMATION_XXX_SGIX and still use GetMap. 43 44 * Mark: Limited memory may make it problematic to use both high-order 45 evaluators and deformations at the same time. The available memory could 46 be traded off between deformations and evaluators (uh-oh --- do I smell an 47 'evaluator object' extension coming?). 48 49 Ziv: The RESOURCE_UNAVAILABLE error mechanism could solves this problem. 50 Too bad it was reject from 1.1. I am not clear about how we introduce it 51 into an extension without having another extension. 52 53 * Mark: Should deformations of texture, normal, and color coordinates be 54 included as well. 55 56 Ziv: As we already define normal deformations to be derived from the 57 geometry deformation, independent normal deformations should not be 58 included. We do need Texture deformation however (e.g., for 3D 59 textures), as texture and object space are different and are 60 included. Color, being a non geometric entity does not seem to belong 61 here. 62 63 * Ziv: spec order issue. The natural specification of deformations is in 64 the Coordinate Transformations section - 2.9. However, deformation use 65 the description of Bernstein polynomials in evaluator section - 5.1 - 66 creating an awkward forward reference. In a formal spec the description 67 of the polynomial would have to move from evaluators to the deformations 68 sub-section. 69 70New Procedures and Functions 71 72 void DeformationMap3{fd}SGIX( enum target, 73 T u1, T u2, int ustride, int uorder, 74 T v1, T v2, int vstride, int vorder, 75 T w1, T w2, int wstride, int worder, 76 T* points); 77 78 void LoadIdentityDeformationMapSGIX( bitfield mask ); 79 80 void DeformSGIX( bitfield mask ); 81 82New Tokens 83 84 Accepted by the <target> parameter of DeformationMap3[fd]SGIX, and by the 85 <target> parameter of GetMap: 86 87 GEOMETRY_DEFORMATION_SGIX 88 TEXTURE_DEFORMATION_SGIX 89 90 Accepted by the <mask> parameter of DeformSGIX, and 91 LoadIdentityDeformationMapSGIX: 92 93 TEXTURE_DEFORMATION_BIT_SGIX 0x1 94 GEOMETRY_DEFORMATION_BIT_SGIX 0x2 95 96 Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, 97 GetFloatv, and GetDoublev: 98 99 DEFORMATIONS_MASK_SGIX 100 MAX_DEFORMATION_ORDER_SGIX 101 102Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 103 104 Section 2.6.3, "GL Commands within Begin/End", is changed to include 105 DeformSGIX in the list of commands allowed within Begin/End. 106 107 The second paragraph of 2.9, "Coordinate Transformations," is replaced by 108 (where Figure 2.6 is modified accordingly): 109 110 Figure 2.6 diagrams the sequence of transformations that are applied to 111 vertices. The vertex coordinates that are presented to the GL are termed 112 object coordinates. The enabled geometry deformations (deformations are 113 described in sub-section XXX, "Deformations") are applied to these 114 coordinates to yield deformed object coordinates. When no deformations are 115 enabled it is as if an identity deformation is applied to the object 116 coordinates. Unless explicitly stated otherwise, in the rest of this 117 document we will refer to deformed object coordinates as just object 118 coordinates. The model-view matrix is then applied to the object 119 coordinates to yield eye coordinates. Then another matrix, called the 120 projection matrix, is applied to eye coordinates to yield clip coordinates. 121 A perspective division is carried out on clip coordinates to yield 122 normalized device coordinates. A final viewport transformation is applied 123 to convert these coordinates into window coordinates. 124 125 A new sub-section entitled 'Deformations' is added after section 2.9.1: 126 127 Deformations provide a means to use a polynomial mapping to transform 128 vertex, normal, and texture coordinates. When a deformation is applied to a 129 4-tuple (c_0,c_1,c_2,c_3) the 3-tuple (c_0,c_1,c2) is transformed by a 130 trivariate deformation map to another 3-tuple, while the c_3 remains 131 unchanged. The mapping of normals is not independent of the vertex mapping 132 but is rather derived from the vertex deformation map. 133 134 Let sum_{i=0}^l represent the sum over i from 0 to l. 135 136 Consider the R^3-valued function: 137 138 p(u,v,w) 139 = 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 140 141 where B_i^j is a Bernstein polynomial as defined in equation 5.1. The R_ijk 142 are control points (as in equation 5.1); they correspond to the <points> 143 specified with the DeformationMap3[fd]SGIX command. <target> is one of the 144 symbolic constants GEOMETRY_DEFORMATION_SGIX or TEXTURE_DEFORMATION_SGIX. 145 <points> is a pointer to (l+1)(m+1)(n+1) blocks of storage (<uorder> = l+1, 146 <vorder> = m+1, and <worder> = n+1). The error INVALID_VALUE is generated 147 if any of <uorder>, <vorder>, or <worder> is less than one, or if their 148 product is greater than MAX_DEFORMATION_ORDER. The three values comprising 149 R_ijk are located at 150 151 <ustride>i + <vstride>j + <wstride>k 152 153 values (either single- or double-precision floating-point, as appropriate) 154 past the first value pointed to by <points>. 155 156 <u1>, <u2>, <v1>, <v2>, <w1>, and <w2> define the pre-image of the 157 the map; a domain point (u', v', w') is evaluated as 158 159 u' - <u1> v' - <v1> w' - <w1> 160 p'(u',v',w') = p( -----------, -----------, -----------) 161 <u2> - <u1> <v2> - <v1> <w2> - <w1> 162 163 The error INVALID_VALUE is generated if any of <ustride>, <vstride>, or 164 <wstride> is less than 3, or if <u1> is equal to <u2>, <v1> is equal to 165 <v2>, or if <w1> is equal to <w2>. 166 167 Deformations are enabled and disabled using Deform. The <mask> parameter is 168 a bitwise OR of symbolic constants indicating which deformations are to be 169 enabled. The symbolic constants GEOMETRY_DEFORMATION_BIT_SGIX and 170 TEXTURE_DEFORMATION_BIT_SGIX correspond to the geometry and texture 171 deformations, respectively. When a bit corresponding to a given deformation 172 is 0, that deformation will be disabled. The error INVALID_VALUE 173 is generated if the <mask> contains bits other than 174 GEOMETRY_DEFORMATION_BIT_SGIX and TEXTURE_DEFORMATION_BIT_SGIX. 175 176 When enabled, geometry deformation maps (currently only one geometry 177 deformation - GEOMETRY_DEFORMATION_SGIX - is defined) are applied to vertex 178 coordinates immediately before the application of the model-view matrix. 179 When a map is applied to a vertex the normal that is associated with that 180 vertex is transformed as described below. Enabled texture deformation maps 181 (current only one texture deformation - TEXTURE_DEFORMATION_SGIX is defined) 182 are applied to texture coordinates immediately prior to the application of 183 the texture matrix. 184 185 Normal coordinates are transformed by each enabled geometry deformation. 186 The transformation proceeds by first computing the partial Jacobian matrix 187 J of p' at the point (u', v', w'): 188 189 J = ( dp'/du' dp'/dv' dp'/dw' ) 190 191 (p' is a column of 3 values, so dp'/ds is also). 192 The transformed normal, n', is found from the untransformed normal, 193 n = ( nx ny nz ), as 194 195 n' = n J^{-1}. 196 197 Note, that as deformations are defined to be applied immediately before the 198 application model-view and texture matrices, they are therefore also applied 199 to the vertices, normals, and textures resulting from EvalCoord and EvalMesh 200 commands. 201 202 LoadIdentityDeformation provides a quick method for setting 203 deformations to the identity deformation. The map for the 204 deformations indicated by the <mask> parameter (with the same 205 interpretation as in Deform) are set to the identity map. The 206 identity deformation maps are order 2 in each of u, v, and w, with 207 <u1>=<v1>=<w1>=0 and <u2>=<v2>=<w2>=1, and the control point being 208 (0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (1, 0, 0), (1, 0, 1), 209 (1, 1, 0), and (1, 1, 1). 210 Note, that unlike Deform, it is not an error for the mask to contain 211 bits other than than GEOMETRY_DEFORMATION_BIT_SGIX and 212 TEXTURE_DEFORMATION_BIT_SGIX. 213 214 The state required for deformations is 2 3-dimensional map specification (as 215 described by the call to DeformMap[fd]SGIX) and a bit mask indicating 216 currently enabled deformations. The maximum possible value for 217 the product of <uorder>, <vorder>, and <worder> for each deformation type is 218 implementation dependent but must be at least 1. Initially, all the 219 deformation maps are the identity map. 220 221Additions to Chapter 3 of the 1.0 Specification (Rasterization) 222 223 None 224 225Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 226and the Framebuffer) 227 228 None 229 230Additions to Chapter 5 of the 1.0 Specification (Special Functions) 231 232 None 233 234Additions to Chapter 6 of the 1.0 Specification (State and State Requests) 235 236 None 237 238GLX Protocol 239 240 XXX - Not figured out yet. 241 242Dependencies on other extensions 243 244 None 245 246Errors 247 248 The error INVALID_ENUM is generated if the DeformationMap3[fd]SGIX <target> 249 parameter is not GEOMETRY_DEFORMATION_SGIX or TEXTURE_DEFORMATION_SGIX. 250 251 The error INVALID_VALUE is generated by DeformationMap3[fd]SGIX if: 252 - any of <uorder>, <vorder>, or <worder> is less than one, or if their 253 product is greater than MAX_DEFORMATION_ORDER; 254 - any of <ustride>, <vstride>, or <wstride> is less than 3; 255 - <u1> is equal to <u2>, <v1> is equal to <v2>, or <w1> is equal 256 to <w2>. 257 258 The error INVALID_VALUE is generated by DeformSGIX if the <mask> 259 contains bits other than GEOMETRY_DEFORMATION_BIT_SGIX and 260 TEXTURE_DEFORMATION_BIT_SGIX. 261 262 The error INVALID_OPERATION is generated if DeformationMap3[fd]SGIX is 263 executed between execution of Begin and the corresponding execution of End. 264 265New State 266 267 Initial Initial 268 Get Value Get Command Type Value Attrib 269 --------- ----------- ---- ------- ------ 270 ORDER GetMap 2 x 3 x Z_1* 1,1,1 - 271 COEFF GetMap 2 x 1* x 1* x 1* x R3 Sec X(2.9.1+) - 272 DOMAIN GetMap 2 x 6 x R Sec X(2.9.1+) - 273 DEFORMATION_MASK GetIntegerv F 0 transform 274 275 - F is a new state variable type: a bitfield mask of flags. 276 277New Implementation Dependent State 278 Minimum 279 Get Value Get Command Type Value 280 --------- ----------- ---- ------- 281 MAX_DEFORMATION_ORDER GetInteger Z 2 282 283