1
\$\begingroup\$

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

\$\endgroup\$
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – tigrou Apr 9 '13 at 13:09
1
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

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

\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – Ganpat Apr 9 '13 at 11:52
  • 1
    \$\begingroup\$ @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. \$\endgroup\$ – Laurent Couvidou Apr 10 '13 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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