I am working on 3D Carousel for android.
I am using this code and the following is my current output.
I want to develop the following 3D shaped carousel.
I refered to the following questions which are already asked in SO.
The following is near to my requirement:
From this I answer I put:
mCamera.rotateY(-((CarouselItem) child).getCurrentAngle());
inside getChildStaticTransformation()
method of Carousel.java
but I'm not getting a perfect result.
Please help me to solve it.
You are using a function called Calculate3DPosition which calculates X, Y, Z positions from the angle and then those are used in a matrix.translate call.
What you need is actually much simpler - you just need to call matrix.rotate with the angle. It might look surprisingly easy when you've finished, but honestly, the only complexity in the 3D code you have copied is from attempting to keep everything facing the user instead of letting it rotate ...