Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirror effect #65

Merged
merged 7 commits into from
Jul 25, 2014
Merged

Mirror effect #65

merged 7 commits into from
Jul 25, 2014

Conversation

orangecoding
Copy link
Contributor

Hey,
I've added a mirror effect using your plugin architecture. I've added a little example as well.

Best
Christian

@brianchirls
Copy link
Owner

Hi, Christian. Thanks so much for the contribution.

We already have the flip node, which does the same thing, both horizontally and vertically. It's a transform node, not an effect node. The difference is that the transform node runs much faster and without its own GPU memory.

It works like this:

var flip = seriously.transform('flip');
flip.source = '#image';
flip.direction = 'vertical'; //default is horizontal
//and so on...

If you'd like to just submit an example for the flip transform, that would be cool and appreciated, since we don't have one. Just please make sure that the canvas size matches the rendered image.

Brian

@orangecoding
Copy link
Contributor Author

Hey,

maybe I am missing something here... Have you tried my new effect. Your suggestion using the flip just flips the image around.. What my effect does is something like this:
http://upload.wikimedia.org/wikipedia/commons/5/5b/Photo_booth_mirror_effect.jpg

Maybe I did't understand you right..? But my current understanding is that my effect is doing something complete different than the transformation you've suggested. 👍

@brianchirls
Copy link
Owner

You're right. I must have written that before I had my coffee this morning.

There are about a million ways to do this, but this one is probably the fastest and easiest so it couldn't hurt to include it. Can you just make a couple fixes? Then I'll merge.

  1. Fix the title of the example.
  2. Adjust the canvas size in the example so it doesn't have all that empty space. You can also use a reformat node to scale it if you want. See how the other examples use it.

Thanks!

@orangecoding
Copy link
Contributor Author

Hey,

I've changed the title and the canvas format. Also I've included a little example of how to use this effect with your webcam. Maybe you could try it out. This effect works great with an image, but with the camera of my macbook, it seems like there's something slightly wrong. It seems like if you get a litte away from the cam, the effect is not centred...?

@brianchirls
Copy link
Owner

Maybe what you're looking for is 0.5 - abs(0.5 - uv.x)?

@orangecoding
Copy link
Contributor Author

Hey. Yep, sometimes live can be that easy. I've fixed the calculation and pushed it. It can now be merged into your dev branch if you want.

brianchirls added a commit that referenced this pull request Jul 25, 2014
@brianchirls brianchirls merged commit c97c918 into brianchirls:develop Jul 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants