Skip to content

Proposal: Use Gecko's convention for matrices. #145

@nical

Description

@nical

Rather than detailing all of the differences, I encourage you to look at Gecko's matrix classes.

It is terribly dangerous to have Servo and Gecko use different conventions for matrices. Especially since the plan is to share more code in the future. Unless there are very good reasons for euclid's matrices to be the way they are, it is more realistic to change Servo than Gecko for obvious reasons (feel free to ask if you want to argue about that).

Also gecko's matrix multiplication works a lot more naturally with units when building transforms up, because Mat<A,B> * Mat<B,C> * Mat<C,D> = Mat<A,D> which reads nicely from left to right, while euclid goes Mat<C, D> * Mat<B, C> * Mat<A,B> = Mat<A, D>. But honestly, the massive interop foot-gun between servo and gecko is what terrifies me.

This is a much bigger change than the units discussion. Basically everything in servo that uses matrices is affected in non-trivial ways.

I apologize for my "We gotta change everything" attitude between this proposal and the other one. I hope that there will be more direct cooperation between gecko and servo devs (at least on the gfx side) and it simply cannot go well if the basic math structures that are all over the rendering engines aren't compatible between the two. I also believe that gecko's math is well battle-tested by now and has grown into a better design than euclid (in the way units are handled and other things that I haven't nagged you about yet).
As a (meager) consolation, I am willing to help with implementing these changes as opposed to just starting bikesheds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions