p.s. An excellent (free) book about 3D graphic programming (OpenGL but explanations are generally usable. There are also examples one could try to "translate" to LC). http://www.arcsynthesis.org/gltut/index.html (by J.L. McKesson)
If you'd like to help test v7 please work on a copy of your stack files, since the scope of new features in that build require a new file format: http://downloads.livecode.com/livecode/
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
If you'd like to help test v7 please work on a copy of your stack files, since the scope of new features in that build require a new file format: http://downloads.livecode.com/livecode/
Reading the notes I understood that the "nine way" stretch basically is for buttons: any image can be defined by 2 concentric rectangles: formattedRect and centerRect , like this:
all the rest inside will be stretched as usual to fill the area inside
I need another thing: deform an image. An image has 4 corners, I need to specify the points of the corner to obtain a four edged polygon, with 4 corners, but not a rectangle. I need to convert a rectangular image to a trapezius image.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
[-hh] wrote:To say it again in simple words:
...
You can do this with a Perspective Transformation Matrix applied to every point of the image. You could start here: https://en.wikipedia.org/wiki/Transform ... projection
so my problem is just how work on images using Livecode. I know how to stretch vertically and horizontally an image, but how you deform it?
In other programming language I can set the four image corners individually, and then image is automatically stretched.
If I used Livecode on every image pixel, the time would become excessive. I ask you if there is some image properties to set individually the corners of an image and then Livecode will stretch correctly the image...
To work on pixel there is the open source AGG library ( https://code.google.com/p/agg/ ), wrote in C++. Before Livecode I worked with a very high level language where AGG was implemented and it was fast, but I don't want to write in C++.
Last edited by MaxV on Fri Aug 01, 2014 1:12 pm, edited 1 time in total.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
[quote="[-hh]Could you please make a simple demo stack (or demo script) how to achieve this with a nine-way-stretch?[/quote]
I wish I could. Now that I've experimented with it it's clear that I had misunderstood its scope: while it's useful for certain types of image stretching control, it doesn't yet support true skewing.
I believe the Skia engine does, though, so if someone can confirm that and come up with syntax for skewing in LC it would make a nice feature request to submit to the DB.
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn