summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shaders/sprite.wgsl3
-rw-r--r--src/camera.rs1
2 files changed, 2 insertions, 2 deletions
diff --git a/shaders/sprite.wgsl b/shaders/sprite.wgsl
index 5a00e24..43f494e 100644
--- a/shaders/sprite.wgsl
+++ b/shaders/sprite.wgsl
@@ -27,7 +27,8 @@ fn vs_main(model: VertexInput, instance: InstanceInput) -> VertexOutput {
var out: VertexOutput;
// rotate the sprite
- let a = vec2<f32>(cos(instance.rotation), sin(instance.rotation));
+ let rotation = -instance.rotation;
+ let a = vec2<f32>(cos(rotation), sin(rotation));
let b = vec2<f32>(-a[1], a[0]);
let rotation = mat2x2<f32>(a, b);
let rotated = rotation * model.position;
diff --git a/src/camera.rs b/src/camera.rs
index fb46158..edc3405 100644
--- a/src/camera.rs
+++ b/src/camera.rs
@@ -151,7 +151,6 @@ impl Camera {
#[allow(clippy::wrong_self_convention)]
fn to_matrix(&self) -> CameraUniform {
- // TODO why do the camera and instances rotate in different directions?
let cos = self.rotation.cos();
let sin = self.rotation.sin();