Archive 17/01/2023.

How to combine Geometry

amit.nath30

Hello,

How can I combine 2 geometry together, I am a unity developer and looking for an alternative of Unity Mesh.CombineMeshes

Eugene

E.g. manually merge content of the several Models.
Since you don’t have strict requrements/explanation of what is ‘combine’, there are a lot of was to do it.

jmiller

Possible similar thread with useful information:

amit.nath30

Yes I have gone through the above forum but did not get my answer.

suppose I have made a VertexBuffer using

float vertices[] = {
        //position                                          normal                      uv
        -quadWidth * .5f,  cubeHeight * .5f,    0,          0.0f, 0.0f, 0.0f,           1.0f,   0.0f,
         quadWidth * .5f,  cubeHeight * .5f,    0,          0.0f, 0.0f, 0.0f,           0.0f,   0.0f,
         quadWidth * .5f, -cubeHeight * .5f,    0,          0.0f, 0.0f, 0.0f,           0.0f,   1.0f,
        -quadWidth * .5f, -cubeHeight * .5f,    0,          0.0f, 0.0f, 0.0f,           1.0f,   1.0f
    };

Urho3D::VertexBuffer* vb = new Urho3D::VertexBuffer (context_);

vb->SetSize(4, Urho3D::MASK_POSITION | Urho3D::MASK_NORMAL | Urho3D::MASK_TEXCOORD1);
vb->SetData(vertices);

and suppose I have 2 of this vertex buffer what will be the easiest way to combine these 2 VertexBuffer?