Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to generate vertices for 3D Diamond Shape in DirectX?

I am creating an application which receive DIAMETER, CROWN, GIRDLE and PAVILION as parameter and render a model of diamond according to parameters.

Refer to the image:

Picture of Diamond with anatomy

share|improve this question
What do you mean by "generate" ? do you want to generate vertexes + triangle indexes from code (based on some parameters) ? If yes, do you have a special reason to do that ? It will be far easier to create a diamond shape in a 3D tool like Blender and then export it. – tigrou Apr 9 '13 at 13:09

If number of sides is a constant, then possibly best solution would be to use 3D model made in 3D modelling application and scale its parts separately.

When you have the model, you can split it height-wise into segments (crown, girdle, pavilion). Then, when you have input parameters you scale the model according to diameter and each of the parts separately.

If you take bottom as base you scale all vertices by pavilion factor, then scale girdle and crown by 1/pavilion*girdle from girdle base and finally scale crown by 1/girdle*crown. This way each segment will be of right size.

share|improve this answer

for generating vertices for a shape, you first must create some sort of layout of the vertices. Start with just position to keep it simple. ( add up more afterwards ). Then you have to manualy alocate an big memory chunk to fill with vertices you are using.

From there you create a BufferResource in Dx11. Then you simply specifiy that you want to bind it as an vertex buffer.

there is more detail and instructions in the link below.

CreateBuffer Information
How to create a vertex buffer information

share|improve this answer
i have read your link, it's about creating a vertex buffer. But i want to generate vertex(Points OR Coordinate) for diamond shape. see image i've added. – Gani Apr 9 '13 at 11:52
@Gani So you want to generate a diamond procedurally, instead of simply using a model? You should edit your question to make it more precise. – Laurent Couvidou Apr 10 '13 at 7:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.