Dev-C++5.2.0.3(gcc4.7.0)
Windows Vista SP2 32ビット
Mobile Intel(R) 965 Express Chipset Family
Intel(R) Core(TM)2 Duo CPU T8100 @ 2.10GHz (2 CPUs)
DXライブラリ v3.08c
です。
自作の3D表示プログラムをDXライブラリに移植してみたのですが、
ポリゴンの端の表示が乱れます。
画像あり、なしともに乱れます。
具体的には、この画像のように、隣のポリゴンの色や画像がはみ出してきます。 これは直せるでしょうか?
ライトの計算はオフ、Zバッファは有効です。
ポリゴンを描画する関数はこのようになっています。
上が画像を貼り付ける関数、下がベタ塗りをする関数です。
void draw3dHenkan(
int x1,int y1,int z1,
int x2,int y2,int z2,
int x3,int y3,int z3,
int isUpper,int bmp) {
y1=-y1;y2=-y2;y3=-y3;
VERTEX3D vertex[3]={};
vertex[0].pos=VGet(x1,y1,z1);
vertex[1].pos=VGet(x2,y2,z2);
vertex[2].pos=VGet(x3,y3,z3);
vertex[0].dif=GetColorU8(255,255,255,255);
vertex[1].dif=GetColorU8(255,255,255,255);
vertex[2].dif=GetColorU8(255,255,255,255);
vertex[0].u=(isUpper?0:1);
vertex[0].v=(isUpper?0:1);
vertex[1].u=1;
vertex[1].v=0;
vertex[2].u=0;
vertex[2].v=1;
DrawPolygon3D(vertex,1,bmp,FALSE);
}
void draw3dColor(
int x1,int y1,int z1,
int x2,int y2,int z2,
int x3,int y3,int z3,
int r,int g,int b) {
y1=-y1;y2=-y2;y3=-y3;
VERTEX3D vertex[3]={};
vertex[0].pos=VGet(x1,y1,z1);
vertex[1].pos=VGet(x2,y2,z2);
vertex[2].pos=VGet(x3,y3,z3);
vertex[0].dif=GetColorU8(r,g,b,255);
vertex[1].dif=GetColorU8(r,g,b,255);
vertex[2].dif=GetColorU8(r,g,b,255);
DrawPolygon3D(vertex,1,DX_NONE_GRAPH,FALSE);
}よろしくお願いします。
なお、このDXライブラリを使用したプロジェクトではサイコロの表示が乱れていますが、
このことについては本家掲示板で質問させていただきました。
http://hpcgi2.nifty.com/natupaji/bbs/pa ... ew&no=2748