Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教一个问题 #15

Closed
gflkdns opened this issue Dec 9, 2016 · 2 comments
Closed

请教一个问题 #15

gflkdns opened this issue Dec 9, 2016 · 2 comments

Comments

@gflkdns
Copy link

gflkdns commented Dec 9, 2016

大神你好,你这个容器真的很棒,但我从它的规律上看他是从两头螺旋向上的,如果想要它变成经纬分明的(只有经度,或者纬度),每个view的方向面向球心,有什么好的思路吗?

另外,如果第一步能实现,可否支持这样一个方法addView(int x,int y,int z);x代表指南针角度(0-360),y代表俯仰角度,z代表左右角度。

实际上我一直在研究这件事😑

@misakuo
Copy link
Owner

misakuo commented Dec 12, 2016

你的意思就是要做一个圆筒形状的呗。。。那更简单了,取到竖直或者水平方向的滚动距离,用三角函数算出缩放比,再重新排序子View就好了,你可以看看我代码里怎么处理滚动角度和子View大小的关系。第二个问题,左右角度其实间接地就代表了子View的缩放比以及z轴的index,这个比较简单,只需要根据缩放比排序一下就好了。

@gflkdns
Copy link
Author

gflkdns commented Dec 12, 2016

嗯 我把TagCloud里面的positionAll(boolean distrEven)方法:
phi = Math.acos(-1.0 + (2.0 * i - 1.0) / max); theta = Math.sqrt(max * Math.PI) * phi;
改了一下就达到效果了,感谢!

@gflkdns gflkdns closed this as completed Dec 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants