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

Re: [E-devel] Evas gradients



	I wrote:
> ...
> ...
>	Lastly, I thought I'd go ahead and add the ability to set
> not just the gradient object's fill-angle, but to allow one to
> set further transforms on the fill.. eg. to skew the fill, and
> what the heck, might as well allow for perspective projections
> as well.
> 
>	The api for fill-skewing is simply:
> 
>   "evas_object_gradient_fill_skew_set(obj, angle_x, angle_y)"
> 
> where angle_x,y give the angles by which to rotate the x,y axes.
> 
>	However, for projections, I'm not entirely certain what
> might be considered a good way for specifying this. I'm inclined
> to have:
> 
>   "evas_object_gradient_fill_project_set(obj, x, y, z)"
> 
> where x,y give offsets relative to the fill origin, and z gives a
> height to project from. But this isn't the only way that this could
> be done... I'll look into it a bit more over the weekend, but if
> anyone feels that they know of a better means of specifying this,
> please do suggest so (I'll go over the semantics of how the various
> transforms are composed a bit later).

	Well, after playing around with this a bit, I feel that the
above interface for projections is probably not a good idea, even if
it does seem somewhat intuitive.

	Instead, I think a better one might be to allow one to set
the angles that one would rotate the fill plane relative to the
z-axis, ie. "angle_xz" and "angle_yz" say, and also allow a further
"scale" parameter. Think of holding a piece of paper the size of
the fill region and then rotating it in the xz and yz planes by the
corresponding angles (where the z-axis points out from the unrotated
piece of paper).

	The api for (gardient) fill-projections would then become:

evas_object_gradient_fill_project_set(obj, angle_xz, angle_yz, scale)

	This works well, is also intuitive, and is consistent with
the other transforms being given via 'angles'.

	One could also introduce a full 3x3 transform matrix (as eg.
xrender has) and allow one to set this.. But this is often not very
intuitive for people. It also has issues with wether or not it would
override the fill size/angle.. and other things.

	In any case, I believe the use of skew and projection angles
is a simple, intuitive, and consistent one (for both grads and images)
and I'm inclined to endorse it. However, if anyone has another means
they feel would be better...

   jose.


PS.
	One can do some really nice 3D animation kinds of effects
with this, very neat stuff. It can also look crappy if you use
projection angles near pi/2 and small fill regions, etc...
	No screenshots, sorry. And no idea when Carsten might
be, or would be, ready for such a 'new evas thing'. :)