fenfire-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fenfire-dev] Re: [Fencommits] libvob: get rid of the old transformR


From: Benja Fallenstein
Subject: Re: [Fenfire-dev] Re: [Fencommits] libvob: get rid of the old transformRect stuff in AWTVobCoorderBase
Date: Fri, 18 Feb 2005 12:52:12 +0100

On Fri, 18 Feb 2005 10:11:34 +0200 (EET), Matti Katila
<address@hidden> wrote:
> On Thu, 17 Feb 2005, Benja Fallenstein wrote:
> > Wed Feb 16 16:48:26 EET 2005  Benja Fallenstein <address@hidden>
> >   * get rid of the old transformRect stuff in AWTVobCoorderBase
> 
> (*sigh*)
> 
> All that work to implement recursive vob scenes for AWT and now all code
> works just like the old Coorder code again...

Well, sorry about that.

The problem is, of course, that our code doesn't *use* recursive vs at
this point, and I don't have any experience with them. -- How about
you make a lob which renders its children in a cached recursive vs,
and we use that in CanvasSpatialView? Then I'd have some basis for
making that run with Coordinates.

>                 /*
>                   XXX doesn't work!!!  Benja: Fix this!
>                 into.setX(cs(), 
> into.x(p2)*into.sx(p1)/into.sx(p2)+into.x(p1));
>                 into.setY(cs(), 
> into.y(p2)*into.sy(p1)/into.sy(p2)+into.y(p1));
>                 */


Done.

>             void doTransformRect(float[] rect, boolean useInterp) {
>                 inverseTransformRect(inds[cs()+2], rect, useInterp);
>                 transformRect(inds[cs()+1], rect, useInterp);
>             }
>             void put(Coordinates into) {
>                 into.setX(cs(), 
> into.x(p2)*into.sx(p1)/into.sx(p2)+into.x(p1));
>                 into.setY(cs(), 
> into.y(p2)*into.sy(p1)/into.sy(p2)+into.y(p1));
>                 into.setSX(cs(), into.sx(p1)/into.sx(p2));
>                 into.setSY(cs(), into.sy(p1)/into.sy(p2));
>                 into.setD(cs(), into.d(p1) - into.d(p2));
>             }
> 
> One is readable, which one?

Um, the one that is too slow to be useful? =-)

Well, perhaps the new code could be made more readable in places like
this. How about

Coordinates {
    void addTransform(int cs, float x, y, sx, sy, d) {
        setX(cs, x(cs)*sx + x);
        ...
    }
    void addTransform(int cs, int transform) {
        addTransform(cs, x(transform), y(transform), sx(transform)...);
    }
    void addInverseTransform(int cs, float x, y, sx, sy, d) {...}
    void addInverseTransform(int cs, int transform) { ... }
}

and then

concatInverse {
    void put(Coordinates into) {
        into.addInverseTransform(cs(), parent2);
        into.addTransform(cs(), parent1);
    }
}

and

ortho {
    void put(Coordinates into) {
        into.copy(getParent(), cs());
        into.addTransform(cs(), floats[f+1], ...);
    }
}

etc.

- Benja




reply via email to

[Prev in Thread] Current Thread [Next in Thread]