Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

Translation transform fails if vertex coordinate != 0

$
0
0

Hello,

I have two vertices for a line:

CUSTOMVERTEX LineVertices[] =
    {
        { 2560.0F, 0.0F, -2560.0F, 0xFFFFFFFF },
        { 2560.0F, 0.0F, 2560.0F, 0xFFFFFFFF }
    };

I use a translation matrix on the vertices:

D3DXMATRIXA16 TranslationMatrix;

D3DXMatrixTranslation(&TranslationMatrix, 1024.0F, 0.0F, 0.0F);
Device->SetTransform(D3DTS_WORLD, &TranslationMatrix));
Device->DrawPrimitive(D3DPT_LINELIST, 0, 1);

The translation will not work on the X or Z coordinates, but it will work on the Y, which is set to 0 in the vertices.

Why doesn't it work?

 

 


Viewing all articles
Browse latest Browse all 17560

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>