2012-07-16 3 views
4

OpenGL 또는 제 3 보조 도구를 사용하지 않고 회전 애니메이션을 사용할 수 있습니까? 고정 레이아웃에서 시계 방향으로 회전하는 3D 자동차 객체를 적용하고 싶습니다.3D 자동차 오브젝트를 회전시킬 수 있습니까?

+0

는 [당신이 시도?] (http://www.inter-fuser.com/2009/08/android-animations-3d-flip.html)에 따라 크기를 조절 – Praveenkumar

+0

그게 바로 플립 애니메이션 너비, 그게 정말 회전 등. 3D 오브젝트의 여러면을 볼 수 없으며 평면 오브젝트의 두 면만 볼 수 있습니다. –

답변

0

3D 자동차를 에뮬레이션하는 스프라이트 애니메이션 시퀀스가 ​​없다면 솔직히 어떻게 할 수 있는지 알지 못합니다. 나는 틀릴 수도 있지만 안드로이드에서 뭔가를 놓쳤을지도 모르지만 나에게 이것은 고전적인 openGL 상황이다.

스프라이트 애니메이션이란 애니메이션 계열의 gif와 같이 2D 시퀀스의 이미지를 의미합니다.

+0

OpenGL을 사용하는 것이 이런 유형의 작업을 수행하는 최선의 선택이라고 말해 주시겠습니까? ??? – Maddy

+0

내 눈에는 OpenGL을 사용하거나 안드로이드 (예 : 믹서기/3dsMax/Maya 등) 외부에서 애니메이션을 적용한 다음 각 프레임을 가져 와서 gif의 일부로 저장해야합니다. –

+0

OpenGL을 사용하면 사용자와의 상호 작용이 가능하며 원하는 방향으로 회전 할 수 있습니다. 허용하면 확대 및 축소 할 수도 있습니다. gif를 사용하면 상호 작용할 수 있지만 애니메이션 시퀀스에서 앞뒤로 이동해야합니다. 더 제한적이므로 사용자가 3D 모델로 수행 할 수있는 작업을 기반으로하는 결정입니다. –

0
1) Well, you first have to set the car in 3D space; 
To model a 3D object, you must define all the vertices of the car as if you were modeling with points and after , linking this point you get the car in wireframe. 


Pont A {x = 3, y = 10, z = 8} 
Point B {x = 5, y = 12, z = 2} 
Point C {x = 6, y = 40, z = 6} 
Point D {x = 7, y = 12, z = 3} 
Point E {x = 3, y = 10, z = 8} 
... 

2) After modeling the car in points, you must define the links of points to form lines, there you have called wireframe modeling, if you want to modeling shapes is different, but with the wireframe already a good idea of the object in the real world. 

Line AB = Point A -> Point B 
Line BC = Point B -> Point C 


3) To spin perfectly the car, you should position it in the center of coordinates,applying in each point the formula translation T with measure the match the distance to the subject from the center at the origin of the axes. 

New point x: 
x = x - Tx 
New point y; 
y = y - Ty 
New point z: 
z = z - Tz 


4) With the car in position to spin it into an angle "g" should be applied to each point the rotation transformation, the formula is: 
  
Find the new point x: 
xt = (x * 1) (* y 0) (z * 0); 
Find the new point y: 
yt = (X * 0) (y * Math.cos (g)) (z * (Math.sin-(g))); 
Find the new point z: 
zt = (X * 0) (y * Math.sin (g)) (z * Math.cos (g)); 


5) After applying the rotation effect, you must return the object to its point of origin, making a reverse translation to step 3. 

New point x: 
x = Tx x 
New point y; 
y = y Ty 
New point z: 
z = z Tz 


This is a roughly explanation but is the most basic way, of course it has more complex formulas that are faster these changes, but to become more didactic I put this way. 
관련 문제