orienting hud

Started by
4 comments, last by Drythe 20 years, 10 months ago
I''m rendering a hud with a quad and was wondering if there was a simple way to orient it towards the camera and on a fixed part of the screen (without vector/matrix stuff). thx!
Advertisement
Just disable depth testing and reset the matrices to identity.

How appropriate. You fight like a cow.
you mean the view/world/projection matrices?
Yep.

How appropriate. You fight like a cow.
you can always use the transformed vertex format.

struct TLVertex
{
FLOAT x, y, z, rhw;
D3DCOLOR specular, diffuse;
FLOAT tu, tv;
};

#define (D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1)

Use this vertex format to render the quad in 2-d space
Take a look at the sprite class. I carve all of my hud components out of a single bitmap and make them sprites so you can use the screen coordinates to position them. You can modify the alpha channel of the bitmap to make them see-through.

Hope it helps,
Pinz.

This topic is closed to new replies.

Advertisement