On Fri, 2008-10-03 at 15:19 +0200, Jörn Reder wrote:
> still playing around with Clutter I faced a problem with proper hiding
> 3D surfaces.
A while ago, I made a little sliding puzzle game in Clutter-Perl and it
had an effect when you completed the puzzle where the new puzzle would
rotate in while the old puzzle rotated out to look like a rotating cube.
I had the same problem of course. I solved it by attaching a handler for
the notify::rotation-angle-y and then lowering the old puzzle once the
angle was greater than 45 degrees. So it was like this:
# connect the signal
$old_puzzle->signal_connect ('notify::rotation-angle-y',
\&lower_on_rotate);
# signal handler
sub lower_on_rotate
{
my ($actor) = @_;
my $angle = $actor->get_rotation ('y-axis');
if (($angle > 0 && $angle < 315) || $angle < -45)
{
$actor->lower_bottom;
$actor->signal_handlers_disconnect_by_func (\&lower_on_rotate);
}
}
It might be more efficient to just use Emmanuele's approach with depth
testing though.
- Neil
--
To unsubscribe send a mail to [EMAIL PROTECTED]