I'm trying to use the android.graphics.camera package to do a 3d
rotation (about the y-axis) of a playing card on a canvas.  Here is
the code that does the transformation:

    camera.save();

    camera.rotateY(rotate);
    rotate += .5f;
    camera.getMatrix(m);

    camera.restore();

    m.preTranslate(-centerX, -centerY);
    m.postTranslate(centerX, centerY);

    canvas.concat(m);

I got this code from the ApiDemos example code
(Rotate3dAnimation.java).  The problem is that at angles close to
perpendicular to the screen (looking at the card close to edge on),
the card disappears.  However, if I get rid of the m.postTranslate
(centerX, 0) call, the card doesn't disappear at certain angles (it's
just now half way off the left side of the screen).  The card is drawn
with a call to canvas.drawBitmap().  Is there any other way to do a 3d
rotation without using OpenGL?  Or should I change the card into an
imageView and use the animation framework?  Thanks for any help.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to