Archive 17/01/2023.

Set UV coordinates on Geometry object

IvanP

I have viewed DynamicGeometry sample. Author there constructs Geometry instance and uses index buffer to optimize vertex usage and to improve calculation of normals on constructed object. But Geometry does not allow you to set UV coordinates needed to map a texture. A CustomGeometry class has this method, but it does not allow you to use index buffer.
Is there any way to set UV coordinates on Geometry?

1vanK
        PODVector<VertexElement> elements;
        elements.Push(VertexElement(TYPE_VECTOR3, SEM_POSITION));
        elements.Push(VertexElement(TYPE_VECTOR3, SEM_NORMAL));
       // Add any vertex attributes