• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            逛奔的蝸牛

            我不聰明,但我會很努力

               ::  :: 新隨筆 ::  ::  :: 管理 ::
            vec4 v, u; mat4 m; v * u component-wise v * m v is row vector m * v v is column vector m * m linear-algebraic matrix multiplication Inverse 求逆 Transpose 轉(zhuǎn)置 gl_ModelViewMatrixInverse; gl_ModelViewProjectionMatrixInverseTranspose gl_NormalMatrix is the transpose of the inverse of the gl_ModelViewMatrix. function prototype: vec4 fract(vec4 x); == x - floor(x); <- [0, 1) // fract 片斷 vec4 clamp(float x, float minVal, float maxVal); returns min(max(x, minVal), maxVal); vec4 mix(vec4 x, vec4 y, vec4 a); return x * (1.0 - a) + y * a; vec4 step(vec4 edge, vec4 x); returns 0 if x < edge, otherwise returns 1. vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); returns if x <= edge0, returns 1 if x >= edge1, perform hermite interpolation between 0 and 1 when edge0 < x < edge1 0到1之間的Hermite插值算法 equal to t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); return t * t * (3 - 2 * t); vec3 cross(vec3 x, vec3 y); // 只有這種形式,即只有三個component的向量才行 dot(N, L); result[0] = x[1] * y[2] - x[2] * y[1]; result[1] = x[2] * y[0] - x[0] * y[2]; result[2] = x[0] * y[1] - x[1] * y[0]; float dot(vec4 x, vec4 y); result = x[0] * y[0] + x[1] * y[1] + ...; vec4 reflect(vec4 I, vec4 N); // 反射光線向量 For the incident vector I and surface orientation N, returns the reflection direction result = I - 2.0 * dot(N, I) * N; vec3 ecPosition = vec3 (gl_ModelViewMatrix * gl_Vertex); vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal); vec3 lightVec = normalize(LightPosition - ecPosition); vec3 reflectVec = reflect(-lightVec, tnorm); vec3 viewVec = normalize(-ecPosition); vec4 refract(vec4 I, vec4 N, float eta); // 折射光線向量 For the incident vector I and surface normal N and the ratio(比率) of refraction eta, returns the refraction vector. The returned result is computed as k = 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I)); if (k < 0.0) { result = 0.0; // the return type is float of vec2/3/4 } else { result = eta * I - (eta * dot(N, I) *sqrt(k)) * N; } mat4 matrixComMult(mat4 x, mat4 y); component-wise to get linear-algebraic multiplication, use the multiply operator (*) mat4 x, y; x * y;
            posted on 2010-12-17 17:23 逛奔的蝸牛 閱讀(1493) 評論(0)  編輯 收藏 引用 所屬分類: OpenGL
            久久午夜免费视频| 久久综合狠狠综合久久激情 | 91久久成人免费| 久久久久亚洲AV无码去区首| 欧美久久综合九色综合| 亚洲国产成人久久笫一页| 日韩精品无码久久久久久| 国产成人久久激情91| 久久久久亚洲AV无码专区桃色| 欧美国产成人久久精品| MM131亚洲国产美女久久| 久久国产影院| 国产精品18久久久久久vr | 久久91精品国产91久久小草| 99久久99久久精品国产片果冻| 亚洲性久久久影院| 欧美亚洲国产精品久久蜜芽| 亚洲综合日韩久久成人AV| 91精品久久久久久无码| 久久婷婷五月综合97色| 日韩影院久久| 久久高潮一级毛片免费| 免费观看久久精彩视频| 无码人妻精品一区二区三区久久 | 亚洲va国产va天堂va久久| 国产农村妇女毛片精品久久| 久久婷婷五月综合色高清| 怡红院日本一道日本久久 | 777久久精品一区二区三区无码 | 久久99国产亚洲高清观看首页 | 很黄很污的网站久久mimi色 | 蜜桃麻豆www久久| 国产三级久久久精品麻豆三级| 欧美久久久久久| 亚洲AV伊人久久青青草原| 久久久久这里只有精品| 久久久久四虎国产精品| 久久午夜电影网| 久久99国产精品久久久 | 波多野结衣久久一区二区| 亚洲精品国产综合久久一线|