Read about my game, project #1 NEW (31st July): There is a new demo, demo #2 at my site. Please try it out.
[i]John 3:16 [edited by - d000hg on August 1, 2002 8:15:22 PM] [edited by - d000hg on August 2, 2002 9:27:58 AM]

struct leaf
{
RECT[Number of textures][Number of rectangles at each texture]
}
//And the rendering loop:
for(i=0 to numTextures)
for(l=0 to numLeaves)
{
draw triangles from leaves[l].Rectangles
}
struct MAPVERTEX1
{
float x,y,z;
DWORD Diffuse;
float u,v;
};
void Terrain::GenerateMAPVERTEX1(MAPVERTEX1 *p,UINT x,UINT y,short z,float u,float v,BYTE c,BYTE a)
{
BYTE r,g,b;
r=(BYTE)min( (255.0f*Light.Ambient.r + c*Light.Diffuse.r),255.0f);
g=(BYTE)min( (255.0f*Light.Ambient.g + c*Light.Diffuse.g),255.0f);
b=(BYTE)min( (255.0f*Light.Ambient.b + c*Light.Diffuse.b),255.0f);
p->Diffuse=D3DCOLOR_ARGB(a,r,g,b);
p->u=u;
p->v=v;
p->x=x*Space;
p->y=y*Space;
p->z=z*Hspace;
}
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more