Registered Member
|
Hi,
What do the alpha shape parameters mean? There are X- and Y-position and sizes and a tilt parameter. There is no appearent logic that I understand, and why the hell doesn't they represent pixels (the X and Y ones)? It would be nice and understandable, and make it possible to worke precicely with eg a title rectangle, og in combination with transform, which uses pixel values. The current values appear random and almost guaranteed to not represent a pixel-relatable position. |
Registered Member
|
Well, I wrapped my head around it - they are o/oo of the frame size (pr thousands, 1/1000's), and they are calculated relative to the x/y center of a given object.
So for an object, eg a rectangle, the calculations are as follows: AS Position X = obj width in pixels + (object width in pixels/2) * 1000/framewidth, rounded (where framewidth is the project render width, eg 1920 for 1080x1920 HD project. AS Position Y = obj height in pixels + ( object height in pixels/2) * 1000 / frameheight, rounded (like 1080 for a 1080x1920 project) rounded AS Size X = Obj width in pixels * 1000 / (framewidth * 2). AS Size Y = Obh height in pixels * 1000 / (frameheight * 2), rounded So for a rectangle at 0, 900 with size 80 x 500px in a 1080x1920 project: AS Position X = 0 + (500/2) * 1000/1920 = 250/1,92 =~ 130 AS position Y= 900 + (80/2) * 1000/1080 = 940/1,08 =~ 870 AS Size X = 500 * 1000 / (1920 * 2) = 500/3,84 =~ 130 AS Size Y = 80 * 1000 / (1080*2) = 80/2,16 =~ 37 I use this to hide an object when sliding it away using transform, so that it can dissapear while sliding in any direction. If you want to do that, don't forget to set the AS transition width prarmeter to 0. Appearently the rounding of the result makes for an accurate rectangle in any examples I trid yet. Also, the formulas can of course be simplified quite a bit using normal mathematical logic, like x * 1000/1080 -> x/1,08. |
Registered Member
|
Wow! Thanks for the math explanation. Will keep this handy next time I need more precision (so far I more or less eyeballed it). Very good to know!
This forum will soon be archived and you won't be able to interact with it anymore. Please use KDE Discuss instead.
|
Registered users: Bing [Bot], gfielding, Google [Bot], Sogou [Bot]