2012-12-28 33 views
1

我必须创建一个像您一样的具有不同数量的行(1,2或3)的3d墙式传送带。我使用this示例并修改了一些变量。像youtube一样的墙上传送带

I have to change the cardVertices(given below) in Carousel.rs to change the size of the cards in the carouselview. I am not sure how to do it dynamically. 

static const float3 cardVertices[4] = { 
    { 0.0, -1.0, -1.0}, 
    { 0.0, -1.0, 1.0 }, 
    { 0.0, 1.0, 1.0 }, 
    {0.0, 1.0, -1.0 } 
}; 

现在我想根据同一个项目中的行数重新调整卡的大小。如果该行是一个,那么我希望卡的尺寸很大,如果它是2,则将卡尺寸设置得较小。 我可以在单独的项目中实现此功能,但我希望在同一个项目中得到结果(我无法上传图像以显示结果应该看起来像) 。

请帮助我,因为这是使用renderscript实现的,而且我对rendescript没有多少了解。任何帮助赞赏。

回答