请问:怎样求法线及光照计算?
假设有这样一组顶点:d=-1;
ff[d=d+1]=0.0f,ff[d=d+1]=0.0f,ff[d=d+1]=0.0f;
for(i=0;i<9;i++)
{
f[0]=(2*D3DX_PI*i)/8;
ff[d=d+1]=cosf(f[0])*3.0f,ff[d=d+1]=sinf(f[0])*3.0f,ff[d=d+1]=-10.0f;
}
三角形索引为:
d=-1;
sy[d=d+1]=0,sy[d=d+1]=1,sy[d=d+1]=2;
sy[d=d+1]=0,sy[d=d+1]=2,sy[d=d+1]=3;
sy[d=d+1]=0,sy[d=d+1]=3,sy[d=d+1]=4;
sy[d=d+1]=0,sy[d=d+1]=4,sy[d=d+1]=5;
sy[d=d+1]=0,sy[d=d+1]=5,sy[d=d+1]=6;
sy[d=d+1]=0,sy[d=d+1]=6,sy[d=d+1]=7;
sy[d=d+1]=0,sy[d=d+1]=7,sy[d=d+1]=8;
sy[d=d+1]=0,sy[d=d+1]=8,sy[d=d+1]=9;
请问:如何求这10个顶点的法线?