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 › Building a reflection
Page Index Toggle Pages: 1
Building a reflection (Read 610 times)
Building a reflection
Feb 23rd, 2010, 6:50am
 
I've been working on a reflection Class, but am a bit stumped.

The way it's working now is simple. Take a snapshot of everything that's going on in the screen from a certain horizon and process that and flip it.

All good and well.

The problem I'm trying to solve is if you have an object that extends over the horizon, ie. coming towards you in 3D space. instead of lying on the floor it is being covered by the reflection. so any part of the main image will be lost that is below the horizon.

The easy peasy way to solved this is of course just to redraw the main graphics again - but this comes with performance costs and when the movement is fast the original and newly drawn gfx are in slightly different positions, so you get a bit of ghosting.  

I'm sure there's a smarter way to do this? any ideas?

cheers
g
Re: Building a reflection
Reply #1 - Feb 24th, 2010, 8:16am
 
One easy answer comes to mind if your horizon is static: during the processing, you could check each pixel against what you know the horizon to be, and only treat it as something to flip if it is different.
Page Index Toggle Pages: 1