What is the unit in DirectX ?

B

Boki

Hi All,

For DirectX, we can set the x, y, z, axis, but what is its unit?

pixel, or center meter or ?
ex: verts[0].X=150;

Best regards,
Boki.
///////////////////////////////////////////
public void OnCreateVertexBuffer(object sender, EventArgs e)
{
VertexBuffer vb = (VertexBuffer)sender;
GraphicsStream stm = vb.Lock(0, 0, 0);
CustomVertex.TransformedColored[] verts = new
CustomVertex.TransformedColored[3];

verts[0].X=150;verts[0].Y=50;verts[0].Z=0.5f; verts[0].Rhw=1;
verts[0].Color = System.Drawing.Color.Aqua.ToArgb();
verts[1].X=250;verts[1].Y=250;verts[1].Z=0.5f; verts[1].Rhw=1;
verts[1].Color = System.Drawing.Color.Brown.ToArgb();
verts[2].X=50;verts[2].Y=250;verts[2].Z=0.5f; verts[2].Rhw=1;
verts[2].Color = System.Drawing.Color.LightPink.ToArgb();
stm.Write(verts);
vb.Unlock();
}

//////////////////////////
 
B

Barry Kelly

Boki said:
Hi All,

For DirectX, we can set the x, y, z, axis, but what is its unit?

pixel, or center meter or ?
ex: verts[0].X=150;

The unit is whatever you want it to be, relative to your viewing
frustum. You can use a view matrix to scale it, etc.

-- Barry
 
B

Boki

Barry Kelly 寫é“:
Boki said:
Hi All,

For DirectX, we can set the x, y, z, axis, but what is its unit?

pixel, or center meter or ?
ex: verts[0].X=150;

The unit is whatever you want it to be, relative to your viewing
frustum. You can use a view matrix to scale it, etc.

-- Barry

Got it, thanks.
Best regards,
Boki.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top