// A couple of assumptions:
// vertex_format is the vertex format created by using the vertex format functions
// buff_model1 is buffer containing vertex data in a known format - can be other models too, of course
// apply_transform(vertex_buffer, transform_matrix) applies a transform to all positions in a buffer
// arr_transforms contains a transformation matrix for each instance (created using matrix_build)
instance_number = 5;
var model_size_bytes = buffer_get_size(buff_model1);
buff_combined = buffer_create(instance_number * model_size_bytes, buffer_fixed, 1);
var buff_temp, i;
i = 0;
repeat(instance_number) {
buff_temp = buffer_create(model_size_bytes, buffer_fixed, 1);
buffer_copy(buff_model1, 0, model_size_bytes, buff_temp, 0); // Keep the original model intact
apply_transform(buff_temp, arr_transforms[i]);
buffer_copy(buff_temp, 0, model_size_bytes, buff_combined, i*model_size_bytes);
buffer_delete(buff_temp);
i++;
}
vertex_buffer = vertex_create_buffer_from_buffer(buff_combined, vertex_format);
vertex_freeze(vertex_buffer); // Always a good thing to do