Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

3D Carousel in Android

I am working on 3D Carousel for android.

I am using this code and the following is my current output.

enter image description here

I want to develop the following 3D shaped carousel.

enter image description here

I refered to the following questions which are already asked in SO.

  1. How to do 3d Carousel with modifications in image's dimensions and angle

  2. How to create list with carousel effect in android

  3. how to increase carousel image space?

  4. Coverflow Carousel effect same as iPhone/iPad in android

The following is near to my requirement:

  1. Using 3d Carousel project to create SPB Carousel style

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.

like image 324
DreamsNeverDie Avatar asked Jan 02 '14 13:01

DreamsNeverDie


1 Answers

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 ...

like image 54
Andy Newman Avatar answered Sep 27 '22 21:09

Andy Newman