PDA

View Full Version : Interpolate an ellipse to a rect



natinusala
05-28-2017, 11:23 AM
Hello,

I was fiddling around on OpenVG with my Rpi3, and I wanted to see if I could create a tiny ripple effect like on Android : starting from a tiny ellipse which grows up to fill out the entire screen.

I wanted it to be best looking than just a simple scaled ellipse, so I thought of using paths interpolation. When I interpolate an ellipse to another ellipse it works, but when I try to interpolate my tiny ellipse into the rect which fills up the screen it fails (vgInterpolatePath returns false).

I've read on the specification that for it to work, paths must be "compatible" : what does this mean ? Is there a way to interpolate an ellipse into a rect ?

Thanks :)

kaufen
07-24-2017, 01:52 AM
Rectangles, lines, and points

Rectangles, lines, and rounded rectangles use cached VGPath objects to try to accelerate drawing operations. vgModifyPathCoords() is used to modify the co-ordinates in the cached VGPath object each time fillRect(), drawRects(), drawLines(), or drawRoundedRect() is called.

If the engine does not implement vgModifyPathCoords() properly, then the QVG_NO_MODIFY_PATH define can be set to disable path caching. This will incur a performance penalty.

Points are implemented as lines from the point to itself. The cached line drawing VGPath object is used when drawing points.

Polygons and Ellipses

Polygon and ellipse drawing creates a new VGPath object every time drawPolygon() or drawEllipse() is called. If the client application is making heavy use of these functions, the constant creation and destruction of VGPath objects could have an impact on performance.

If a projective transformation is active, ellipses are converted into cubic curves prior to transformation, which may further impact performance.

Client applications should avoid polygon and ellipse drawing in performance critical code if possible.