Skip to content

How to rotate the object? #1

Description

@PolGraphic

Hi. Thank you for the great and simple render engine!

I know I can rotate the camera with e.g. rotate_y(-.1f);.

The problem is, how to rotate the object itself (single object)?

I was trying with engine::render() changes:

 for (int i = 0; i < scene.things.size(); i++) {
    thing* t = scene.things[i];
    mesh m = t->get_mesh();
    t_transform * tt = m.get_t_transform(); //get transformation?
    tt->set_rotation(new vector3(0, rotationValue, 0)); //set rotation?
    image texture = t->get_texture();
    matrix4 mt = t->t.get_projected_t_transformation();
    rast->draw_mesh_textured(*frame, m, texture, mt);
}

But it had no impact on model rotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions