Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Laborator3::Update(float deltaTimeSeconds)
- {
- // TODO: update steps for translation, rotation, scale, in order to create animations
- translateX += deltaTimeSeconds * 8.5f;
- translateY += deltaTimeSeconds * 8.5f;
- scaleX += deltaTimeSeconds * 0.5f;
- scaleY += deltaTimeSeconds * 0.5f;
- angularStep += deltaTimeSeconds * 2.9f;
- angularstep2 += deltaTimeSeconds * 2.5f;
- modelMatrix = glm::mat3(1);
- modelMatrix *= Transform2D::Translate(translateX, translateY);
- modelMatrix *= Transform2D::Translate(50, 50);
- modelMatrix *= Transform2D::Rotate(angularstep2);
- modelMatrix *= Transform2D::Translate(-50, -50);
- // TODO: create animations by multiplying current transform matrix with matrices from Transform 2D
- RenderMesh2D(meshes["square1"], shaders["VertexColor"], modelMatrix);
- modelMatrix = glm::mat3(1);
- modelMatrix *= Transform2D::Translate(translateX, translateY);
- modelMatrix *= Transform2D::Rotate(angularstep2);
- modelMatrix *= Transform2D::Translate(200, 400);
- modelMatrix *= Transform2D::Translate(50, 50);
- modelMatrix *= Transform2D::Rotate(angularStep);
- modelMatrix *= Transform2D::Translate(-50, -50);
- //modelMatrix *= Transform2D::Scale(scaleX, scaleY);
- //TODO create animations by multiplying current transform matrix with matrices from Transform 2D
- RenderMesh2D(meshes["square2"], shaders["VertexColor"], modelMatrix);
- modelMatrix = glm::mat3(1);
- modelMatrix *= Transform2D::Translate(translateX, translateY);
- modelMatrix *= Transform2D::Rotate(angularStep);
- modelMatrix *= Transform2D::Translate(70, 200);
- modelMatrix *= Transform2D::Translate(50, 50);
- modelMatrix *= Transform2D::Rotate(angularstep2);
- modelMatrix *= Transform2D::Translate(-50, -50);
- //modelMatrix *= Transform2D::Rotate(angularstep2);
- //TODO create animations by multiplying current transform matrix with matrices from Transform 2D
- RenderMesh2D(meshes["square3"], shaders["VertexColor"], modelMatrix);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement