はちゅね が 痛々しい件について
テクスチャー・マッピング・モデルを回転させる例題ですが、
元データは右腕とネギが分離したオブジェクトだったので右腕がない。気のせいか泣き叫んでいるようだ。哀れ。
モデリングわかんないんだよ!勘弁して...と思ったがあまりにかわいそうなのでEXCELと手作業で腕をくっつけた。
よくよく考えればJavaScriptで頂点番号にオフセットを足しこんでやればよかったな。かわいそう過ぎてあせってしまったようだ。
Image URL:
// World View Projection matrix that will transform the input vertices // to screen space. float4x4 worldViewProjection : WorldViewProjection; // The texture sampler is used to access the texture bitmap in the fragment // shader. sampler texSampler0; // input parameters for our vertex shader struct VertexShaderInput { float4 position : POSITION; float2 tex : TEXCOORD0; // Texture coordinates }; // input parameters for our pixel shader struct PixelShaderInput { float4 position : POSITION; float2 tex : TEXCOORD0; // Texture coordinates }; /** * The vertex shader simply transforms the input vertices to screen space. */ PixelShaderInput vertexShaderFunction(VertexShaderInput input) { PixelShaderInput output; // Multiply the vertex positions by the worldViewProjection matrix to // transform them to screen space. output.position = mul(input.position, worldViewProjection); output.tex = input.tex; return output; } /** * Given the texture coordinates, our pixel shader grabs the corresponding * color from the texture. */ float4 pixelShaderFunction(PixelShaderInput input): COLOR { return tex2D(texSampler0, input.tex); } // Here we tell our effect file *which* functions are // our vertex and pixel shaders. // #o3d VertexShaderEntryPoint vertexShaderFunction // #o3d PixelShaderEntryPoint pixelShaderFunction // #o3d MatrixLoadOrder RowMajor