How would you mirror a bezier curve

BlitzMax Forums/BlitzMax Beginners Area/How would you mirror a bezier curve

Matt McFarland(Posted 2005) [#1]
I'm stuck.. I've been trying to figure out how to mirror a set of bezeir curves and I can't find the logical answer. At first glance, you would think that all you have to do is swap(or inverse) the x coordinates. However, this is not the case at all.


If you have two, three, four, or five, or more bezier curves all linked to each other making a wonderous and complex spline coming from the lower-lefthand point of your screen, (like maybe a few loopty-loops along the way) and lets say it stops somewhere in the middle.


Now lets say we want to do the exact same thing but from the other side of the screen. Visually you can see the bezier curve looking just like the other one, but only flipped horizontally and moved over to the right. Ok, sound easy? For a human to do with their hands, sure. For me to do with a paint program, no problem! For blitzmax, I have no freakin clue!! The problem is I can't seem to figure out how find the exact X coordinates needed to make a complete mirror of the highly complex spline.

The most important part of this exercise is that we cannot change the spline formula to make the reverse, but instead we want to find the correct X coordinates and do so using some sort of mathematical algorythm. The math alg is important because I'd like to be able to do this on the fly, meaning the actual mirror cannot be "hardcoded."

If anyone has anything they can bring to the table to shed some light on this subject I welcome it! :)


Warpy(Posted 2005) [#2]
newx = screenwidth - oldx


Unless I'm missing something important.


Matt McFarland(Posted 2005) [#3]
hmm I think that'll do the trick, I can't believe I was stuck over one line! Thansk Warpy, I think this will work, will give it a try when I get home..