sh0dan // VoxPod

Sunday, April 10, 2005

Nuts and Bolts

I finally found a little time this weekend for my little project. Not much, but I got around trying to fix some of the bugs I've discovered. Mainly the skew function is giving me headaches. I noticed that the old implementation caused distortions along the triangle edge.

The image is drawn using two triangles. When I moved one of the corners it resulted in artifacts along the edge. My first idea was to draw four triangles instead and include a center coordinate. That went rather smooth and actually resulted in some nicer looking code.

My second problem was - that this didn't solve the first problem. ;) So after playing a bit around I thought I'd have to move the center point to avoid the artifacts. Actually I started by moving the UV coodinate of the center point, but that still resulted in artifacts - so I moved on to actually move the vertice itself. It helped a bit, but I'm still far for satisfied with the result.

A bit frustrated I moved on to something simpler. Implementing textboxes that show the selected values selected by this sliders. Thank god that went without problems, so now I'll go to sleep, having actually achieved some kind of progress on the app. Here is a screenie:


  • If you're dealing with the same problem that I had with my 'perspective' filter, it's simple: you have to modify the W-coordinate of the points to do the blit. If you attempt to do a 4-point mapping that is not parallelogram-to-parallelogram with constant-W, you will get shearing along the triangulation line, because affine mapping can only accommodate three arbitrary points. You need perspective mapping to handle four points, and that requires setting the w of the coordinates. I wrote about this problem in my 12/14/2003 news entry under Archived News. There is a much easier way to compute the matrix through cross-products, but I seem to have lost the link.

    By Blogger Phaeron, at 11:59 pm  

  • Not to troll, here's an interesting read on the nuts and bolts of Apples Core Image Technology:

    I thought you might find bits and pieces interesting. Check out the section on Image Units.

    By Anonymous Thomas Pilgaard Miller, at 10:48 pm  

Post a Comment

<< Home