DirectX9 has utilities (prefixed with D3DX) which can do what you need. Use this function:

```
HRESULT D3DXCreateSphere(
IDirect3DDevice9* pDevice,
float radius,
unsigned int slices,
unsigned int stacks,
LPD3DXMESH* mesh,
LPD3DXBUFFER* adjacency
);
```

But if you don’t want to use DirectX’s mesh structure (D3DXMESH), then you’ll have to generate the sphere yourself.

If you’re interested, I can make a short article on implementing the algorithm for both OpenGL and DirectX.

Hope that helps.

Hi,

In OpenGL we can choose what we want do draw like GL_QUADS for Square and other stuff … but in DirectX there is just TRIANGLE and other stuff related to it. :unsure: So, we have to use triangles to draw squares and other stuff … right?

My question is if I want to draw a Sphere … how can I do that? Do I have to generate it by an alogrithm or is there a function for it …? :wtf: