Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

EDIT:
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
1  
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

2 Answers 2

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
1  
@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

 
discard

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.