3D旋转木马在Android中 [英] 3D Carousel in Android

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

问题描述

我工作的3D旋转木马的机器人。

我用这 code 并以下是我的电流输出。

我要制定如下三维形状的旋转木马。

我refered以下几个问题这已经问左右。

  1. <一个href="http://stackoverflow.com/questions/15268674/how-to-do-3d-carousel-with-modifications-in-images-dimensions-and-angle">How做3D旋转木马,在图像的尺寸和角度修正

  2. <一个href="http://stackoverflow.com/questions/19508936/how-to-create-list-with-carousel-effect-in-android">How创建列表,在安卓的旋转木马效果

  3. 如何增加旋转木马图像空间?

  4. <一个href="http://stackoverflow.com/questions/20677100/coverflow-carousel-effect-same-as-iphone-ipad-in-android">Coverflow旋转木马的效果相同,iPhone / iPad的Andr​​oid中

以下是靠近我的要求:

  1. <一个href="http://stackoverflow.com/questions/11726377/using-3d-carousel-project-to-create-spb-carousel-style">Using 3D旋转木马项目,以创建国家邮政局旋转木马风格

从这个我回答我提出:

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

getChildStaticTransformation() Carousel.java ,但我没有得到一个完美的结果。<方法/ P>

请帮我解决这个问题。

解决方案

您使用的是被称为Calculate3DPosition函数计算X,Y,从角度,然后这些都在matrix.translate调用中使用Z轴位置。

您需要的其实是非常简单的 - 你只需要调用matrix.rotate的角度。它看起来非常容易,当你完成了,但说实话,你已经复制到3D code的唯一复杂性是试图把一切都面临的用户,而不是让它旋转......

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

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

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