이 link을 사용하여 체크 아웃 할 수있는 CarouselExample에 대한 도움이 필요합니다. 수직으로 회전시키고 싶습니다. .rs 파일에서 getMatrixForCard라는 메소드를 발견했습니다.이 메소드는 카드 행렬의 변환이 완료된 곳입니다. 방법은 다음과 같습니다.수직 회전식 둘러보기 렌더 스크립트
static bool getMatrixForCard(rs_matrix4x4* matrix, int i, bool enableSway, bool
enableCardMatrix)
{
float theta = cardPosition(i);
float swayAngle = getSwayAngleForVelocity(velocity, enableSway);
rsMatrixRotate(matrix, degrees(theta), 0, 1, 0);
rsMatrixTranslate(matrix, radius, getVerticalOffsetForCard(i), 0);
/* rsMatrixTranslate(matrix, 0, radius, 0);*/
float rotation = cardRotation + swayAngle;
if (!cardsFaceTangent) {
rotation -= theta;
}
rsMatrixRotate(matrix, degrees(rotation), 0, 1, 0);
bool stillAnimating = false;
if (i == animatedSelection) {
float3 scale;
stillAnimating = getAnimatedScaleForSelected(&scale);
rsMatrixScale(matrix, scale.x, scale.y, scale.z);
}
// TODO(jshuma): Instead of ignoring this matrix for the detail texture, use card
bounding box
if (enableCardMatrix) {
rsMatrixLoadMultiply(matrix, matrix, &cards[i].matrix);
}
return stillAnimating;
}
그래서이 줄에서 y 값을 x로 변경하면 효과가 있음을 알 수 있습니다.
rsMatrixTranslate(matrix, radius, getVerticalOffsetForCard(i), 0);
그러나 그렇지 않습니다. 제발 누군가가이 예제를 확인하고 나에게 도움이되는 방법을 알고 회전 목마를 수직으로 만들면 제발 고맙겠습니다.
를 따를 때 출력이 될 것입니다 될 수 있습니다 수직 회전식을 했니? – zaiff