ThreeDee
![]() |
I would like to share ideas for creating perspective in FF.
I'll start with the simplest possible example of making a proper perspective distortion. At least it shows the basic way this works. The method is similar to using Profile Gradients and Offset to scale an image. The difference is that the percentage input is mapped with the depth information. Here's the sample, which is essentially achieved by 5 Components. (As you can see, it would look better if scaled down vertically. That is one of the most likely things you would do in actual use, unless you want a "wide angle" distortion.) Snippet attached. ![]() Perspective Distort Snippet.ffxml |
|||
Posted: September 15, 2008 2:48 pm | ||||
CFandM
![]() |
Also I found that if you can get some interesting distortions...Almost like a bloat and punk type of effect...
This is a nice and WAY COOL snippet I will be playing with this one all day..Many ideasl.. ![]() ![]() bloated punk.ffxml Stupid things happen to computers for stupid reasons at stupid times! |
|||
Posted: September 15, 2008 3:31 pm | ||||
ThreeDee
![]() |
The simple distort above may not work for all purposes, so here's another one: The Infinite Plane.
Here we employ methods piloted by Matrix and Sphinx to create the plane (It's not actually infinite, for there are 201 copies of the original at the horizon, but close enough for most purposes). This involves shrinking the image down first and doing the offsetting in the opposite direction from the first example, that is, scaling the image up with perspective distortion. Now we could get into the complexities of how the correct bias curve for keeping the perspective linear is calculated... better skip it at this point and just be happy with the output of the snippet. Here's how it looks; again you see that the image goes into "wide angle" below the center line, so if a "normal" perspective is needed, you could for instance just use the upper half. Snippet attached. ![]() Infinite Plane Snippet.ffxml |
|||
Posted: September 15, 2008 3:55 pm | ||||
ThreeDee
![]() |
It is easy to see that many variations on the theme -- such as a road or a not-so-infinite plane -- can readily be made by masking off portions of the image right before the perspective distortion.
Scaling this output vertically will give you a great number of "different" perspectives. With these two snippets and some additional scaling and masking you can do create almost any x-axis-rotated perspective plane. If you want to get even fancier, you can probably add a "Any Angle Rotate" both before and after the perspective distortion step in the snippet, the first one to rotate the plane around the y-axis and the second one to rotate it around the z-axis. (Haven't tried that as yet, but at least in theory it should work -- I'll do that next). |
|||
Posted: September 15, 2008 4:04 pm | ||||
ThreeDee
![]() |
So here it is, the fancier version with two Uberzev "Any Angle Rotate" snippets added.
Z-axis rotation forced me to mask off areas where the image wrapped around from the other side incorrectly, so something needs to be done about that if you want to rotate around that axis. Other than that, worked fine. Rotated 45 degrees around Y-axis, 15 degrees around Z-axis: ![]() Infinite Plane Advanced Snippet.ffxml |
|||
Posted: September 15, 2008 4:58 pm | ||||
ThreeDee
![]() |
Quite a number of 3D-landscape possibilities: Ground planes, water planes, cloud planes -- now we're talking!
Not to mention walls, floors, ceilings... |
|||
Posted: September 15, 2008 5:09 pm | ||||
Vladimir Golovin
Administrator |
Wow. Very nice!
|
|||
Posted: September 16, 2008 3:01 am | ||||
Sjeiti
![]() |
Ah this is great... I was waiting for something like that. This opens the door to a whole new range of filters.
I remember Uberfez showed some perspective thing like that, but as with most of his teasers, he never submits them ![]() |
|||
Posted: September 16, 2008 4:27 am | ||||
ThreeDee
![]() |
Some interesting warp effects, indeed. Well worth developing into something. |
|||
Posted: September 16, 2008 8:25 am | ||||
Crapadilla
![]() |
I'm sure uberfez would disagree, but:
ThreeDee, you're the man! ![]() --- Crapadilla says: "Damn you, stupid redundant feature requests!" ;) |
|||
Posted: September 16, 2008 8:26 am | ||||
rgoer
Posts: 46 |
Can you explain the logic of the particular values used in the "bias" curve in the infinite plane snippet? Did you just eyeball them and it happened to work out perfectly, or is there a mathematical reason that this creates a perspective projection?
|
|||
Posted: September 16, 2008 5:58 pm | ||||
ThreeDee
![]() |
There's a mathematical reason it does, but it'd give me a headache to try and figure out exactly what it is. Nevertheless, by asking this question, you actually managed to make me figure out the formulas, which is a good thing, for I had been asking if anyone can...
The figures are related to the number of repeats in the profile gradient used to shrink down the original image. When you shrink down the image using that method, you get 2x+1 copies of the original image, where x is the number of repeats. (In the Infinite Plane snippet you have 100 repeats in the gradients, which results in 201 images in each direction.) The reverse transformation Bias curve settings work with these formulas: Bias = -x/(x+1)*100 Maximum = 50-50/(2x+1) Thus, with the Infinite Plane snippet, which has 100 repeats in the gradient, you get: Bias -99.0099, Maximum 49.7512 As to exactly why these formulas work, all I have to say is that my math coprocessor works independently from my language processor -- in other words, I probably couldn't explain it if I tried, not even to myself. (Well, let me attempt to explain one thing: the reason the Maximum setting is approaching 50 as the number of repeats increases, is because that is the 50% gray that results in no offsetting. Thus the resultant image where after the two transformations the bottom row of pixels is the same as in the original -- and if you can follow that trail of logic, I'm amazed.) |
|||
Posted: September 16, 2008 9:50 pm | ||||
Carl
![]() |
Thanks, opens up some fun stuff ![]() ![]() ![]() |
|||
Posted: September 17, 2008 4:55 am | ||||
ThreeDee
![]() |
Rgoer, one more note on the logic behind the math, if it helps, as to why it is the Bias curve that works: the Bias curve is an inverse function, while perspective is a function of the inverse square. The bias curve works in one axis, so on two axes it becomes "Bias squared" or inverse square.
|
|||
Posted: September 17, 2008 5:50 am | ||||
ThreeDee
![]() |
About perspective view normalization:
The Infinite Plane Snippet gives you a 90 degree field of view, so if you want to normalize it to 60 degrees (human vision), scale it up so you see 2/3 of the default output from that snippet. Another normalization factor is that you might want to center the vanishing point, which is now at the top center by moving it. (If you just do it by scaling vertically, you will technically speaking still have a wide-angle view.) |
|||
Posted: September 17, 2008 7:21 am | ||||
Crapadilla
![]() |
ThreeDee, you should post these snippets to the library... very important stuff!
![]() --- Crapadilla says: "Damn you, stupid redundant feature requests!" ;) |
|||
Posted: March 24, 2009 3:03 pm | ||||
James |
Very cool, thanks ThreeDee
![]() |
|||
Posted: March 25, 2009 7:30 am | ||||
CFandM
![]() |
+100 ![]() Stupid things happen to computers for stupid reasons at stupid times! |
|||
Posted: March 27, 2009 5:35 am | ||||
Indigo Ray
![]() |
Alright, I never saw this thread. Completely disregard my incoming snippet.
Also, ThreeDee, I hope you don't think I'm leeching off of you by submitting perspective filters. I'm just trying to come up with creative additions to your prodigal ingenuity. Keep it up! ![]() |
|||
Posted: March 29, 2009 6:42 pm | ||||
Professor Fate
![]() |
Really neat. Thanks for posting!
|
|||
Posted: April 3, 2009 5:31 am | ||||
SpaceRay
![]() |
I agree with Vladimir, WOW, this are very nice, well done, interesting and useful, and are different perspective possible and not just the plain one Thanks |
|||
Posted: August 11, 2012 11:02 pm | ||||
ThreeDee
![]() |
In FF3 perspective transformation is extremely simple. You just use the scale component set to 0 and feed a gradient to the percentage input. Black is view plane (0 distance), white is horizon (infinity).
Note: If you want the images to go all in the same direction, not flip around every other row, you have to enable Seamless tiling in the overrides. (Filter Editor: Filter>Overrides...). ![]() |
|||
Posted: August 12, 2012 3:37 am | ||||
Morgantao
![]() |
DOH!
Why am I seeing this thread only now?
Double DOH! I uploaded a filter to your other thread, ThreeDee, where I used 2 gradients and a lookup for the same result. 4 times. In one filter.... Tripple DOH! After typing a slightly longer post a few hours ago, my computer crashed, so I now had to retype ![]() |
|||
Posted: August 13, 2012 1:02 pm | ||||
SpaceRay
![]() |
I always make a copy in the notepad of the post that I am writing if it will include more than 3 lines, so while I am writing I copy in intervals to the notepad and save it, and so if anything happens and I loose the post I have already a copy of it, at least until the problem happened. And I always for ALL the posts select all the text written and make a copy of the to the clipboard |
|||
Posted: August 15, 2012 4:08 am | ||||
Morgantao
![]() |
I copy to the clipboard too, except when I forget. And somehow the server\my computer\my internet connection knows that I forgot, because naturally that's when something goes wrong
![]() |
|||
Posted: August 15, 2012 4:07 pm |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,712 Registered Users
+19 new in 30 days!
153,533 Posts
+31 new in 30 days!
15,348 Topics
+73 new in year!
33 unregistered users.