Sphinx.
![]() |
I translated some parts of a graphics library I'm co-developer on, so now we have a true four point projective transformation, and it supports both ways (i.e. you can transform "back" by using opposite setting for Inverse parameter).
I added some additional parameters, Percentage, Clip X and Clip Y. Percentage works similar to Percentage in the other transformations. I will publish it eventually, but I post it here first to get some feedback on the design. Also I'm unsure about license compatibility when submitting to the online library. Projective Transform (1).ffxml |
|||||
Posted: July 5, 2010 7:10 am | ||||||
Sphinx.
![]() |
Here is a moderate example with clipped x and y:
![]() |
|||||
Posted: July 5, 2010 7:15 am | ||||||
Sphinx.
![]() |
And here is a more extreme unclipped example:
![]() |
|||||
Posted: July 5, 2010 7:15 am | ||||||
ThreeDee
![]() |
Sphinx,
This is awesome to say the least! It will open a whole world of possibilities in mapping images onto 3D surfaces. As to the interface, it is workable as it is. The 'inverse' checkbox should work the other way though, IMO. Right now it is checked when you do the original transform, and unchecked for inverse transform. For a possible improvement, it would be helpful to be able to show just a tranformed grid overlayed on the input image. This would be particularly useful for alignment when removing perspective with inverse transformation. TD |
|||||
Posted: July 5, 2010 8:27 am | ||||||
ThreeDee
![]() |
Oh, and could the clip function have some sort of invert choice as well? With some settings, the transformed image splits and goes through the opposeite edges of the image. (Or is this the way it is supposed to go?)
|
|||||
Posted: July 5, 2010 8:36 am | ||||||
Sphinx.
![]() |
I guess that makes sense from how you see it visually. Theoretically or codewise it is the other way around though (i.e. it uses the inverse matrix when Inverse is checked). Maybe there is a better term for that input.
Well, the thing is that for correct output the transform only support convex quadrilateral polygons. I was not sure how to handle this and decided to leave it as is - any ideas on what to with concave settings? |
|||||
Posted: July 5, 2010 9:20 am | ||||||
Sphinx.
![]() |
Hmm, I could constrain the points so that you can't make a concave polygon.. the sliders would then stop having any effect if you make a concave polygon..
|
|||||
Posted: July 5, 2010 9:49 am | ||||||
ThreeDee
![]() |
You could call it 'Inverse Transform' and switch the checkbox polarity.
I see. Then contraining the points might be a good idea. It is not all that important, more of a cosmetic handling. Now that we've gone there: should there be some way of indicating when the points are clipped? Such as a red exclamation point at the corner (which you can turn off)? That's just a thought. In the big picture, it's irrelevant for the basic function of the filter, which is a fantastic piece of work. |
|||||
Posted: July 5, 2010 11:06 am | ||||||
SpaceRay
![]() |
I am sorry to ask, but do not know how this would help mapping images onto 3D surfaces unless you mean doing this inside FF in some way, although FF does not have 3D surfaces. Sorry if I am telling perhaps silly things here. As Sphinx has put already, this is related to this other thread Quadrilateral Challenge by uberzev |
|||||
Posted: September 5, 2012 11:29 pm | ||||||
ThreeDee
![]() |
Yes, I mean internally in FF. For instance, if you were to make a script that calculated the corner points of the three visible faces of a 3D rotating cube, you could use this script to render the input image on each face. You could pretty much make any rectanglarly faceted filled 3D shape with the input image on each face with it. Which reminds me that it would really be a good idea to write a script that calculates the transformation of any point in 3D space. In fact, 3D transformation may already be included in one of the more advanced scripts from Sphinx. Or in Raytracing by Egret. Haven't dug into them that deep. (By 3D transformation I mean rotation around X, Y and Z-axis.) |
|||||
Posted: September 6, 2012 5:23 am | ||||||
CFandM
![]() |
Great Work Sphinx..
![]() ![]() Stupid things happen to computers for stupid reasons at stupid times! |
|||||
Posted: September 6, 2012 7:51 am | ||||||
AndrewA1988 |
Does anyone still have this snippet? Attachment goes to a "not found" page.
|
|||||
Posted: February 12, 2020 2:51 am | ||||||
Sphinx.
![]() |
I'm not sure why the older forum attachments are not working anymore (GMM? Vlad?).
Here it is Projective Transform.ffxml |
|||||
Posted: February 16, 2020 8:24 am | ||||||
AndrewA1988 |
Thanks Sphinx!
|
|||||
Posted: February 18, 2020 9:38 pm | ||||||
GMM
Moderator
Posts: 3491 |
We restored this particular attachment. If you any other older attachment doesn't show up, let me know. |
|||||
Posted: February 19, 2020 4:40 am |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,711 Registered Users
+18 new in 30 days!
153,533 Posts
+38 new in 30 days!
15,348 Topics
+73 new in year!
17 unregistered users.