Android 中的 3D 轮播 [英] 3D Carousel in Android

查看:27
本文介绍了Android 中的 3D 轮播的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发适用于 android 的 3D Carousel.

我正在使用这个

  • 如何创建带有轮播效果的列表安卓

  • 如何增加轮播图片空间?

  • Coverflow Carousel 效果与 iPhone/iPad 相同在安卓中

  • 以下接近我的要求:

    1. 使用 3d Carousel 项目创建 SPB Carousel 样式

    从这个我回答我说:

    mCamera.rotateY(-((CarouselItem) child).getCurrentAngle());

    Carousel.javagetChildStaticTransformation() 方法中,但我没有得到完美的结果.

    请帮我解决.

    您正在使用一个名为 Calculate3DPosition 的函数,该函数从角度计算 X、Y、Z 位置,然后在 matrix.translate 调用中使用这些位置.

    您需要的实际上要简单得多 - 您只需要使用角度调用 matrix.rotate 即可.当您完成后,它可能看起来非常简单,但老实说,您复制的 3D 代码中唯一的复杂性是试图让所有东西都面向用户而不是让它旋转......

    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.

    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.

    解决方案

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

    这篇关于Android 中的 3D 轮播的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆