Git Product home page Git Product logo

Comments (6)

nical avatar nical commented on May 29, 2024

cc @SimonSapin, @glennw, @pcwalton, @metajack, @asajeffrey, @nox
Big topic. I wish I had looked into these before MozLondon.

from euclid.

nical avatar nical commented on May 29, 2024

Hm, I delved a bit and I realize the issue is not as I bad as I thought: the only convention difference is in the order in which transformations are expressed (A = B x C vs A = C x B). The resulting matrix is laid out the same way gecko and servo which means the interop issue is only that gecko devs may mistakenly write a.mul(b) when writing they should write b.mul(a) in servo code. When I filed this I though the matrix layout was not the same which mean creating a matrix in gecko and pass it to webrender would be incorrect (which was terrifying).

May bad. That said, having the same conventions in gecko and servo would really help if we are to share more code so my proposal still holds.

In short: change the order of multiplications: a.mul(b) would produce the equivalent of what b.mul(a) does currently, and translate/scale/etc. would turn into pre_translate/post_translate/pre_scale/etc. to avoid making mistakes (servo's current operations are pre_ operations).

from euclid.

glennw avatar glennw commented on May 29, 2024

Changing the order of the operations to match what gecko does sounds good to me!

from euclid.

peterjoel avatar peterjoel commented on May 29, 2024

I don't know anything about Gecko, but the Euclid matrix layout is different from the w3c geometry specifications. For example, this geometry specification uses the last column for translation, while Euclid uses the last row.

There may be more value in compatibility with specifications than with Gecko.

from euclid.

pcwalton avatar pcwalton commented on May 29, 2024

I don't really have much of an opinion either way.

from euclid.

nical avatar nical commented on May 29, 2024

I have a branch [1] on top of the units work, with pre- and post-operations exposed explicitly (I even removed mul in favor of pre_mul/post_mul). It also has row-major and column-major interfaces implemented to help with interfacing with the DOM or whatnot (cf. issue #146), and I added a lot of the missing documentation.

Feedback very welcome. So far my impression is that nobody is opposed to what I propose here. Other people in the gfx team also expressed that it would be nice to have familiar interfaces in euclid (about the pre and post transforms).
I'll make a pull request if/when the units stuff moves forward (I'm confident I'd mess up rebasing two dependent PRs).

[1] https://github.com/nical/euclid/blob/pre-post/src/matrix4d.rs

from euclid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.