我工作的3D旋转木马的机器人。
我用这 code 并以下是我的电流输出。
我要制定如下三维形状的旋转木马。
我refered以下几个问题这已经问左右。
How做3D旋转木马,在图像的尺寸和角度修正
How创建列表,在安卓的旋转木马效果
如何增加旋转木马图像空间?
Coverflow旋转木马的效果相同,iPhone / iPad的Android中
以下是靠近我的要求:
Using 3D旋转木马项目,以创建国家邮政局旋转木马风格从这个我回答我提出:
mCamera.rotateY( - ((CarouselItem)子).getCurrentAngle());
在 getChildStaticTransformation()
Carousel.java
,但我没有得到一个完美的结果。
请帮我解决这个问题。
解决方案您使用的是被称为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.
How to do 3d Carousel with modifications in image's dimensions and angle
How to create list with carousel effect in android
how to increase carousel image space?
Coverflow Carousel effect same as iPhone/iPad in android
The following is near to my requirement:
Using 3d Carousel project to create SPB Carousel styleFrom 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 ...
相关推荐
最新文章