Rot + Scale!
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#define GLM_FORCE_RADIANS
|
||||
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/constants.hpp>
|
||||
|
||||
namespace cve {
|
||||
struct SimplePushConstantData{
|
||||
@@ -47,6 +48,8 @@ namespace cve {
|
||||
triangle.model = cveModel;
|
||||
triangle.color = {0.1f, 0.8f, 0.1f};
|
||||
triangle.transform2d.translation.x = .2f;
|
||||
triangle.transform2d.scale = {2.f, .5f};
|
||||
triangle.transform2d.rotation = .25f * glm::two_pi<float>();
|
||||
|
||||
gameObjects.push_back(std::move(triangle));
|
||||
}
|
||||
@@ -179,6 +182,8 @@ namespace cve {
|
||||
cvePipeline->bind(commandBuffer);
|
||||
|
||||
for (auto& obj: gameObjects) {
|
||||
obj.transform2d.rotation = glm::mod(obj.transform2d.rotation + 0.001f, glm::two_pi<float>());
|
||||
|
||||
SimplePushConstantData push{};
|
||||
push.offset = obj.transform2d.translation;
|
||||
push.color = obj.color;
|
||||
|
||||
Reference in New Issue
Block a user