-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Y-axis is Inverted #22
Comments
Maybe it's related to the way WebGPU's coordinate system is defined? |
I'm still not sure the root cause, but that coord system link did lead me to a fix. The fact that the wgpu NDC is lower left origin, but the texture is upper left origin, and that both were inverted got me looking at the
Fixes it for both For the final fix, it might be more correct to make the change in With a little guidance, I can probably put together a pull request though for this fix. |
Hmmm yeah |
Basically this should fix it, but I need to check whether the error is perhaps in the conversion to diff --git a/src/kit/mod.rs b/src/kit/mod.rs
index 9116518..594ea65 100644
--- a/src/kit/mod.rs
+++ b/src/kit/mod.rs
@@ -186,15 +186,15 @@ impl<T> Animation<T> {
///////////////////////////////////////////////////////////////////////////////
pub fn ortho(w: u32, h: u32, origin: Origin) -> Matrix4<f32> {
- let (top, bottom) = match origin {
+ let (bottom, top) = match origin {
Origin::BottomLeft => (h as f32, 0.),
Origin::TopLeft => (0., h as f32), |
I'm trying to understand the coordinate system in RGX and think that there is an inverted y-axis somewhere. I've modified the
sprite
example to only create one instance of the sprite in the batch as follows:then the pipeline is set to:
However, the sprite then appears in the upper left (and is upside down). Similarly, if I change the origin in
kit::ortho
toOrigin::TopLeft
, the the sprite is in the BottomLeft.This is on metal backend.
The text was updated successfully, but these errors were encountered: