ivanik


i have 2 question

1.iam confuse how to correctly match the size of image (ex: *.tga 256x256) to the 3D space when we using CustomVertex.PositionTextured, how can we render the actual size of image in the 3D space

2. ex:

void OnCreateBuffer(object sender, EventArgs e)
{
VertexBuffer buffer = (VertexBuffer)sender;

positionTex = new CustomVertex.PositionTextured[4];
positionTex[0].Position = new Vector3(-1.0f, 1.0f, 0);
positionTex[0].Tu = 0; positionTex[0].Tv = 0;
positionTex[1].Position = new Vector3(1.0f, 1.0f, 0);
positionTex[1].Tu = 1.0f; positionTex[1].Tv = 0;
positionTex[2].Position = new Vector3(-1.0f, -1.0f, 0);
positionTex[2].Tu = 0.0f; positionTex[2].Tv = 1.0f;
positionTex[3].Position = new Vector3(1.0f, -1.0f, 0);
positionTex[3].Tu = 1.0f; positionTex[3].Tv = 1.0f;

buffer.SetData(positionTex, 0, LockFlags.None);
}

this buffer will create polygon wiht the width =2 n height =2;

so what the meaning is 2 in width n height, 2 pixel or 2 inch or..



Re: Game Technologies: DirectX 101 size in the 3D space

Yorthen

The meaning of 2 is 2 units, there's no connection between units and any other unit of measurement since how big the polygon is will depend on a lot of things like the position of the camera and the size of the viewport used. Imagine that the polygon is positioned in front of you, the size of the polygon (as seen) is then dependent on the distance to it.

The good news is that this means that you should be able to think of it as any "real" unit you like (such as metre, millimetre, or inches) just as long as you use the same unit everywhere. What you can't do is think of it as "fake" units such as pixels since pixels are a purely virtual and 2D concept while you are working in 3D.

This means that trying to get an image (used as a texture on a plane for example) shown in its actual size is just a matter of positioning the camera and adjusting the size of the viewport (not necessarily an easy task).

--
Erik Wikstrom