opengl – Keeping two triangles with different scale attached during rotation

I’m making a simple Lunar Lander clone. The ship is a triangle, and I’m trying to draw the exhaust fumes of the ship.

I’m wondering how to draw the exhaust so it’s always relative to the ship. I’m currently trying to offset it’s x and y position on the screen by using the following code:

if (m_state == State::Thrust) {
    // Calculate position for small triangle
    float flameSize = SHIP_SIZE / 2;
    glm::vec2 flamePosition = shipPosition;

    float cos = glm::cos(glm::radians(m_rotation));
    float sin = glm::sin(glm::radians(m_rotation));

    float dx = 0;
    float dy = SHIP_SIZE;

    flamePosition.x = cos * dx - sin * dy + m_position.x;
    flamePosition.y = cos * dy + sin * dx + m_position.y;

    m_pRenderer->Render(flamePosition.x, flamePosition.y, flameSize, flameSize, 180.0f + m_rotation, glm::vec3(1.0f, 0.0f, 0.0f));
}

However I’m not getting the desired result:

enter image description here

The small exhaust triangle is always off by some offset. It’s worth nothing that when I don’t scale the exhaust triangle, it rotates correctly, so I think that could have something to do with the issue but I can’t see how that would effect the positions I’m calculating. For reference, here is the code I use to render:

m_pShader->use();
glm::mat4 model = glm::mat4(1.0f);
model = glm::translate(model, glm::vec3(x, y, 0.0f));

model = glm::translate(model, glm::vec3(0.5f * height, 0.5f * width, 0.0f));
model = glm::rotate(model, glm::radians(rotation), glm::vec3(0.0f, 0.0f, 1.0f)); 
model = glm::translate(model, glm::vec3(-0.5f * height, -0.5f * width, 0.0f)); 

model = glm::scale(model, glm::vec3(width, height, 1.0f));

m_pShader->setMat4("transform", model);
m_pShader->setVec3("uColour", colour);


glBindVertexArray(m_vao);

glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

glDrawArrays(GL_TRIANGLES, 0, 3);
glBindVertexArray(0);

I’m wondering what is the correct way to keep smaller triangle attached to the bottom of the bigger one?

Thanks.