We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › flipping the capture from camera
Page Index Toggle Pages: 1
flipping the capture from camera (Read 464 times)
flipping the capture from camera
Jan 19th, 2008, 8:05pm
 
hello,

I would like to flip (on x axis only) the capture from camera?

Is there a method for doing this, or it has to be done pixel-wise?

All the best!
Re: flipping the capture from camera
Reply #1 - Jan 19th, 2008, 10:58pm
 
if you're using P3D or OPENGL, you can flip the image with the rotateX() method.
Re: flipping the capture from camera
Reply #2 - Jan 19th, 2008, 11:18pm
 
pseudo-code:

2d mode:
for( j to height )
for( i to width )
dest[j*width+(width-1-i)] = src[j*width+i];


in 3d mode:
instead of using rotateX just flip the texture coordinates when you pass to the api. that way you save a couple of operations like mul, etc.

just an idea..
Re: flipping the capture from camera
Reply #3 - Jan 20th, 2008, 4:18pm
 
thanks for replies!

I am working in OPENGL so, yes I did use rotateX() and it works just fine; tough I will keep the other idea in mind as well Wink

cheers!
Page Index Toggle Pages: 1