我可以使用旋轉動畫而不使用任何OpenGL或任何第三方工具。我只想在佈局layout.yout中應用順時針旋轉的3D汽車對象。我可以旋轉3D車對象嗎
回答
除非你有某種模擬3D汽車的精靈動畫序列,否則我不明白你是如何做到這一點的。我可能是錯誤的,雖然可能錯過了Android的東西,但對我來說這是一個經典的OpenGL情況。
通過精靈動畫我也意味着任何形式的二維序列圖像,例如GIF動畫。
這意味着你想告訴我,使用OpenGL是我做這種類型的任務的最佳選擇...? – Maddy 2012-07-16 10:08:53
在我眼裏,要麼你必須使用OpenGL,要麼你需要首先在android之外進行動畫製作(例如在blender/3dsMax/Maya等),然後把每一幀都保存爲gif的一部分。 – 2012-07-16 10:18:53
使用OpenGL將允許用戶進行交互,並允許它們以任何他們希望的方向旋轉,如果允許它們放大和縮小。使用GIF他們可以互動,但只能在動畫序列中前後移動。它更加有限,所以它確實是基於您希望用戶能夠使用3D模型做出的決定。 – 2012-07-16 10:20:19
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.
- 1. 我可以旋轉3D球UIImage嗎?
- 2. Java中旋轉對象3d
- 3. 對象的3D旋轉
- 4. 獲取iPhone旋轉和方向以實時旋轉3d對象
- 5. 在2D場景中旋轉3D對象
- 6. WPF中的3D對象旋轉
- 7. 如何在Java 3D中旋轉對象?
- 8. Open GL Android 3D對象旋轉問題
- 9. 在3d中檢測對象的旋轉
- 10. iOS的 - 在scenekit旋轉3D對象
- 11. Unity 3D旋轉游戲對象
- 12. 匹配對象的3D旋轉
- 13. cocos3d中的3d對象旋轉問題
- 14. Actionscript 2.0給對象3D旋轉?
- 15. 將iPhone旋轉應用於3d對象
- 16. 圍繞中心旋轉3D對象
- 17. 旋轉後移動3D對象
- 18. 如何在C#3D中旋轉對象?
- 19. 修復旋轉3D對象Perl代碼
- 20. Unity:旋轉3D對象以對齊2D等距字段
- 21. 我們可以旋轉頁面嗎?
- 22. 我可以旋轉glOrtho()的視圖嗎?
- 23. 通過設備旋轉旋轉簡單的3d對象
- 24. iPhone屏幕旋轉:我可以強制旋轉90度嗎?
- 25. 使用JFreeChart可以在3D中旋轉軸嗎?
- 26. 我可以將3D幾何對象放在JavaFXCollection中嗎?
- 27. 我可以將JSON對象轉換爲JAXB對象嗎?
- 28. 我可以將Stream對象轉換爲FileInfo對象嗎?
- 29. 我可以將Microsoft.Office.Interop.Excel.Chart對象轉換爲Microsoft.Office.Tools.Excel.Chart對象嗎?
- 30. 如何旋轉opengl 3d對象以指向GPS位置(lat,long)?
[你試過嗎?(http://www.inter-fuser.com/2009/08/android-animations-3d-flip.html) – Praveenkumar 2012-07-16 09:17:24
那只是一個翻轉動畫沿調整大小寬度,它不是真的像這樣旋轉。您不會看到3D物體的多個面,只有平面物體的兩面。 – 2012-07-16 09:20:01