D3D quads

Started by
0 comments, last by Teflaun 24 years, 4 months ago
Using two D3D triangles to make a quad, what is the size of the quad in 3D space that a 64x64 tile would be? 64?

D3DLVERTEX v[4];
v[0] = D3DLVERTEX(D3DVECTOR(-32, 32,500),D3DRGB(1.0,1.0,1.0),D3DRGB(0,0,0),0,0);
v[1] = D3DLVERTEX(D3DVECTOR( 32, 32,500),D3DRGB(1.0,1.0,1.0),D3DRGB(0,0,0),1,0);
v[2] = D3DLVERTEX(D3DVECTOR(-32,-32,500),D3DRGB(1.0,1.0,1.0),D3DRGB(0,0,0),0,1);
v[3] = D3DLVERTEX(D3DVECTOR( 32,-32,500),D3DRGB(1.0,1.0,1.0),D3DRGB(0,0,0),1,1);

Advertisement
Hi,
it only depends on you. You might set the camera far away from the triangles, so they would be smaller. But my suggestion would be using D3DTLVERTEX, because then you use untransformed and unlit vertices and simply use the screen coords for the verts. So, you want it to be 64x64 ? Then simply use
code:
D3DVECTOR no1 = (0, 0, 0);D3DVECTOR no2 = (0, 64, 0);D3DVECTOR no3 = (64, 64, 0);D3DVECTOR no4 = (64, 0, 0);

And that's it. The texture should exactly fit onto the quad.

CU

------------------
Skullpture Entertainment
#40842461

Graphix Coding @Skullpture Entertainmenthttp://www.skullpture.de

This topic is closed to new replies.

Advertisement