Re: [css3-transforms] Relation between mathematical description and effect of a transformation

2012/4/22 Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>:
> Yes, these graphics in
> http://www.w3.org/TR/2012/WD-css3-transforms-20120403/#transform-3d-rendering
> implicate more or less some central projection.
> Interestingly the text talks mainly on matrix multiplication again.
> Once you managed to calculate the "accumulated 3D transformation matrix"
> you still need a (presumably simple) method/function together with this
> matrix to present the result on the screen. A matrix is no graphical
> presentation result. For example 3 you basically multiply the
> point (x,y,z) with a 3x3 matrix, you get a result (x',y',z') and you use
> (x',y') for the presentation.
> For 4x4 matrices you can multiply a point (x,y,z,p) with a 4x4 matrix
> and you get a result (x',y',z',p') and obviously you will not use only (x',y')
> for the presentation, if you want to get something like examples 4-7.

Correct.  This isn't in the spec now because it's not clear what to do
with negative values of p'.  If p' is positive, then it's clear we
want (x'/p', y'/p').  And if p' is nonpositive for all four corners of
a box, we want the box not to render.  But it's not at all obvious
what to do if some corners of a box have p' > 0 and some have it <= 0.

I've proposed a solution at
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=15605#c9>.  Perhaps
you could give some feedback on it.

> My assumption is, that this is a quite simple function, with most of the not
> completely trivial things you need already stored in p'.

It's mathematically pretty simple.  If w > 0, (x, y, z, w) is mapped
to (x/w, y/w, z/w).  If w < 0, (x, y, z, w) is mapped to nothing.  The
point (0, 0, 0, 0) is also mapped to nothing.  And for (x, y, z) not
the origin, the point (x, y, z, 0) is mapped to the point at infinity
in the direction of (x, y, z).  But how to translate this into
something that can actually be rendered on the screen is not so
obvious, which is why the spec doesn't yet say anything about it -- we
don't have text that's agreed upon.

Received on Monday, 23 April 2012 08:54:16 UTC