Hey guys, I'm trying to make a 3d cube using the following code

Matrix mMatrix = canvas.getMatrix();
>
> canvas.save();
> camera.save();
> camera.rotateY(-angle);
> camera.getMatrix(mMatrix);
> mMatrix.preTranslate(-width, 0);
> mMatrix.postTranslate(width, 0);
> canvas.concat(mMatrix);
> canvas.drawBitmap(bmp1, 0, 0, null);
> camera.restore();
> canvas.restore();
>
> camera.rotateY(90 - angle);
> camera.getMatrix(mMatrix);
> mMatrix.preTranslate(-width, 0);
> mMatrix.postTranslate(width2, 0);
> canvas.concat(mMatrix);
> canvas.drawBitmap(bmp2, width, 0, null);
>
>
And this is how the cube looks like

<https://lh5.googleusercontent.com/-dm1B6ffM6-4/UD_4eVrYzXI/AAAAAAAABSM/xiosxJZG9jU/s1600/Untitled-2.png>
But I want it to look like this

<https://lh3.googleusercontent.com/--clVYHTVEoM/UD_4rzloojI/AAAAAAAABSU/H2X4eAhhS1U/s1600/Untitled-3.png>

It's because when the Camera rotates images, some part of the image gets 
hidden. Like this

<https://lh4.googleusercontent.com/-imeIWQrcQAY/UD_6JbNzCFI/AAAAAAAABSc/CSSLxZJBnzU/s1600/Untitled-4.png>

I tried a lot of things but nothing really works. I know this could be done 
easily with opengl but I'm just trying to do this with canvas.

Any help is appreciated.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to