how to make a rect.

Started by
13 comments, last by 31337noob 18 years, 3 months ago
How do you make a rectangle with a color in directx9. oh and happy new years.
Advertisement
if u just need a colored 2d rectangle:
with two triangles, made of transformed vertices which include data for a diffuse color
can you give an example?
You're going to want a triangle strip. Take a look here for how to put two triangles together as a strip.

How much do you know about DX?

That's actaully a great tutorial all around, so if the code on that page doesn't make sense, take a look.
is there another way to make a rectangle instead of using vertexs
Try to make use of the d3ddevice->clear() parameters and see if it fits your needs, but using vertices would be the way to go...
cant i use

HRESULT ColorFill(
IDirect3DSurface9 * pSurface,
CONST RECT * pRect,
D3DCOLOR color
);
ok i tried using colorfill and it didnt work right.

so, how would i make a box using vertices?


see, i am tring to make a progressbar.
Quote:Original post by kingnosis
You're going to want a triangle strip. Take a look here for how to put two triangles together as a strip.

How much do you know about DX?

That's actaully a great tutorial all around, so if the code on that page doesn't make sense, take a look.


Actually, a triangle strip is pretty much pointless for one quad.
Quote:Original post by Dave
Quote:Original post by kingnosis
You're going to want a triangle strip. Take a look here for how to put two triangles together as a strip.

How much do you know about DX?

That's actaully a great tutorial all around, so if the code on that page doesn't make sense, take a look.


Actually, a triangle strip is pretty much pointless for one quad.


ok, so how would i do it?

This topic is closed to new replies.

Advertisement