3D旋转木马在Android中 [英] 3D Carousel in Android
问题描述
我工作的3D旋转木马的机器人。
我用这 code 并以下是我的电流输出。
我要制定如下三维形状的旋转木马。
我refered以下几个问题这已经问左右。
-
<一个href="http://stackoverflow.com/questions/15268674/how-to-do-3d-carousel-with-modifications-in-images-dimensions-and-angle">How做3D旋转木马,在图像的尺寸和角度修正
-
<一个href="http://stackoverflow.com/questions/19508936/how-to-create-list-with-carousel-effect-in-android">How创建列表,在安卓的旋转木马效果
-
<一个href="http://stackoverflow.com/questions/20677100/coverflow-carousel-effect-same-as-iphone-ipad-in-android">Coverflow旋转木马的效果相同,iPhone / iPad的Android中
以下是靠近我的要求:
- <一个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.
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 ...
这篇关于3D旋转木马在Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!