OpenGL4csharpライブラリでC#プログラムを入手しました。これは3Dキューブを作成し、マウスとキーボードでスペースを移動できます。同じオブジェクト上の複数のテクスチャopengl4csharp
実際、キューブには1つのテクスチャしか均一に適用されません。私の問題は、各面に異なるテクスチャを適用したいということです。
私は次のようにテクスチャ配列とtextureId配列を開始しようとした:とそれらをバインドするために、
diceTextures = new Texture[6];
diceTextures[0] = new Texture("top.jpg");
diceTextures[1] = new Texture("bottom.jpg");
diceTextures[2] = new Texture("left.jpg");
diceTextures[3] = new Texture("right.jpg");
diceTextures[4] = new Texture("front.jpg");
diceTextures[5] = new Texture("back.jpg");
diceUint = new uint[diceTextures.Length];
for (uint ui = 0; ui < diceTextures.Length; ui++)
{
diceUint[ui] = diceTextures[ui].TextureID;
}
を次にOnRenderFrame方法で:
Gl.UseProgram(program);
Gl.ActiveTexture(TextureUnit.Texture0);
Gl.BindTextures(0, diceTextures.Length, diceUint);
しかし、何も変化し、最初1つのテクスチャだけをバインドするときと同じように、配列のテクスチャがキューブに表示されます。
テクスチャがフェイスに適用されることをどのように達成できますか?
は拘束正しい食感とは別に顔を描きます。 –