By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,467 Members | 1,553 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,467 IT Pros & Developers. It's quick & easy.

What is the unit in DirectX ?

P: n/a
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();
}

//////////////////////////

May 12 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Boki" <bo******@ms21.hinet.net> wrote:
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
May 12 '06 #2

P: n/a

Barry Kelly 寫道:
"Boki" <bo******@ms21.hinet.net> wrote:
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.

May 12 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.