function request: skew Image
Displaying 1-20 of 21 total.
12
next
RageCage
|
Being able to quickly skew an image is about the only thing missing from the verge graphics library. This would be useful for those people doing their 3D verge stuff as well as useful for me.
I could make my own skew funct but I dont believe it would be able to be nearly fast enough to do what I need it to.
what do you think?
Posted on 2004-09-18 21:19:43
|
vecna
|
Im sure there's probably a formal graphical definitions, but I cant quickly find one. The actual word 'skew' has a fairly vague connotation of distortion. Statistical distributiosn can be skewed. When you say 'skew', what exactly do you mean in terms of a graphics function? What would the function prototype look like?
Posted on 2004-09-18 22:15:11
|
RageCage
|
the difference between a square and a parallelagram or a trapezoid(I'm sure I spelled those wrong). Really a distortion function might be a better word. It would take a square image and, with new coords for each vertex, distort the image into it.
Posted on 2004-09-19 00:20:45
|
Gayo
|
My guess is that he means reshaping a square image into an irregular quadrilateral. It would be pretty neat to have if you wanted to use 3d rotational effects on a 2D image (for example, you could make a cube out of six skewed square images), but that's virtually all I can think of doing with it.
Edit: Doh! Too late.
Posted on 2004-09-19 00:21:27 (last edited on 2004-09-19 00:21:57)
|
Technetium
|
Heh. I tried figuring out how to write a function to do that in Verge, and got nowhere really fast. I was trying to have it draw each pixel of the image by replacing the pixel with two VC triangles (forming a square). Then you could move the points of the two triangles to distort the 'pixel', and effectively distort the whole image by changing them all. But getting an actual function to figure out how to distribute the distortions for each pixel to get the end result you want turned out to be way way over my head.
Posted on 2004-09-19 01:30:56
|
Gayo
|
Two notes about that: First of all, Triangle is a bit broken, so it might not do what you wanted it to anyhow. Secondly, it would be indescribably slow.
Posted on 2004-09-19 02:43:41
|
Omni
|
Er...I made one of these. Namely, a DistortBlit(x1, y1, x2, y2, x3, y3, x4, y4, srcimage, destimage). It has glitches. Email me if interested.
Posted on 2004-09-19 04:48:18
|
Omni
|
In case anybody is interested, here is a picture of a parallelogram distort...
Admittedly the distort is no where near clean, since it makes use of numerous RotScales and Scaleblits. But hey, guess what? It's not per-pixel, and it's certainly faster than...per-pixel.
The image used is one of Interference22's font sheets, his font, not mine. Which, of course, I could take down at his request.
The only problem is that it distorts a quadrilateral by in reality distorting two triangular halves of the quadrilateral, so there will be warping across any image that is not a triangle. In fact, the entire thing, though it works, is really just plain not pretty sometimes. If I get more time to work on my 3D engine though, I'll probably end up using this, and I did send a copy of it to Basil for him to check for his own engine, though whether he'll find a use for it, I've no clue.
Posted on 2004-09-19 18:07:02 (last edited on 2004-09-19 18:11:07)
|
basil
|
Quote:Originally posted by Omni
I did send a copy of it to Basil for him to check for his own engine, though whether he'll find a use for it, I've no clue.
Really? I never got it but I'm still quite interested in having a look, could you resend?
Also, I remember v2 had a magical Tmappoly function, what are the odds of seeing a port of that? It would make texturemapping much, much easier, if still not really fast enough to be viable...
Posted on 2004-09-20 00:50:59
|
Omni
|
Er...the old TMapPoly function was really buggy, I heard, or something. Crash-happy, whatever, for some reason I never heard of it getting any use. But then, I could be wrong. I'll try re-sending the thing--to your V3 account email, right?
May take me a day or two.
Posted on 2004-09-20 02:36:55
|
rpgking
|
Didn't Skarlath use TMapPoly for his Texture Mapped polygon demo?
Posted on 2004-09-20 04:40:29
|
zaril
|
Wow, Omni works in 800x600!
Posted on 2004-09-20 08:30:03
|
mcgrue
|
Quote:Originally posted by zaril
Wow, Omni works in 800x600!
Yes, he's the reason why extroversity ain't the default theme. ;)
Posted on 2004-09-20 09:53:46
|
Omni
|
No, I don't work in 800x600, I switch to it for screenshots. So the shots are smaller, you know?
Posted on 2004-09-20 13:30:56
|
mcgrue
|
alt-prntscrn.
Posted on 2004-09-20 14:23:48
|
Omni
|
Er...is that supposed to do something special? Works like a normal Print Screen for me.
Posted on 2004-09-20 14:58:26
|
mcgrue
|
...try it with a window active?
Edit: For example, I get [this] when I do alt-printscrn to my browser window and paste the result into PSP.
Posted on 2004-09-20 15:01:55 (last edited on 2004-09-20 16:07:53)
|
RageCage
|
whoa, awsome screen... and awsome little print screen trick!
Posted on 2004-09-21 05:06:24
|
Omni
|
Yeah, I'll probably just upload the distortion library soon, maybe today, though how useful it will be I don't know.
Posted on 2004-09-21 14:39:42
|
Omni
|
Uploaded to Verge3 -> Utilities.
er...And updating it says the Parent_ID is not set.
Posted on 2004-09-21 20:47:54 (last edited on 2004-09-21 20:53:23)
|