Skip to content

[Question] How do I create a custom mesh from a list/array of vertices? #1112

Answered by jrouwe
Mahmoud1205 asked this question in Q&A
Discussion options

You must be logged in to vote

Here's an example:

// Create a half cylinder with caps for testing contact point limit
{
VertexList vertices;
IndexedTriangleList triangles;
// The half cylinder
const int cPosSegments = 2;
const int cAngleSegments = 512;
const float cCylinderLength = 2.0f;
for (int pos = 0; pos < cPosSegments; ++pos)
for (int angle = 0; angle < cAngleSegments; ++angle)
{
uint32 start = (uint32)vertices.size();
float radius = cCharacterRadiusStanding + 0.05f;
float angle_rad = (-0.5f + float(angle) / cAngleSegments) * JPH_PI;
float

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Mahmoud1205
Comment options

@jrouwe
Comment options

Answer selected by Mahmoud1205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1111 on May 26, 2024 10:21.