Wouldn't it be cool to have a 3D UI in your Android ™ application? I'm Erik Hellman, Lead Software Architect for Android development at Sony Ericsson, and I'll explain how to make this possible. In this article, I 'll describe how to incorporate 3D with Android 's UI API and OpenGL ES 2.0 graphics, and I provide a bitmap code example that can be used as input to a texture in OpenGL ES 2.0. Being a game developer for Android is getting easier every day. The devices are getting high-end GPUs, loads of memory and have nice multi-touch displays. There are also several game engines announcing their support for Android, making the time-to-market for game developers much less than it used to be. Creating advanced games for Android no longer requires a huge project involving hundreds of people and spanning over 2 years or more. While game engines can help us create advanced 3D games, it is not as easy to create an application that uses 3D graphics to enhance the user experience. The engines are focused towards gaming and usually lack a tight integration with the existing Android API and services. In this post, I will explain how you can combine the best from Android's UI APIs with hardware accelerated OpenGL ES 2.0 3D graphics. At Droidcon 2011 in Berlin, I presented a session on this topic and showed some demos of how 3D graphics can enhance your applications. Visitors in the Sony Ericsson booth at droidcon 2011 in Berlin, Germany. The main problem with doing 3D graphics in Android applications is that the Android API for UI (android.widget.* and android.view.*) has no solution for manipulating the View objects in 3D. OpenGL ES 2.0 on the other hand can do 3D very well, but has no knowledge about Android's touch and input APIs, lacks layout managers and is really bad at rendering content such as text. The first thing I'll show is how you can combine the two technologies in the best possible way. All user-interface components in Android are based on the View class. Regardless if you show a button, text or a list of objects, you will use one of the many sub-classes of View. When a View, and all its children, is drawn there are two things happening. All Views in the hierarchy are first measured and then the layout manager in Android positions them as specified. This is done by a call to the measure and layout method in the View class. All this usually happens behind the scenes in standard Android 2D UI, but if you wish to use your Android View in a 3D scene you need to do this by yourself. Once measure() and layout() have been called we can draw the View using the draw() method. This method takes a Canvas as a parameter. The Canvas, in turn, can be created to draw on a Bitmap. This is where we tie it all together in a nice utility method: public static Bitmap drawViewToBitmap(View view, Bitmap bitmap) { bitmap.eraseColor(Color.TRANSPARENT); int bitmapWidth = bitmap.getWidth(); int bitmapHeight = bitmap.getHeight(); Canvas canvas = new Canvas(bitmap); int measureWidth = View.MeasureSpec.makeMeasureSpec (bitmapWidth, View.MeasureSpec.EXACTLY); int measuredHeight = View.MeasureSpec.makeMeasureSpec (bitmapHeight, View.MeasureSpec.EXACTLY); view.measure(measureWidth, measuredHeight); view.layout(0, 0, bitmapWidth, bitmapHeight); view.draw(canvas); return bitmap; } The above method lets you reuse the same Bitmap instance and thus reduces the amount of memory allocations you have to do (which takes time). The Bitmap that we just drew our View to can be used as input to a texture in OpenGL ES 2.0 that can be placed on a 3D model (or, in the simplest case two triangles forming a flat quad). For examples of how to create a simple OpenGL ES 2.0 application where we use bitmaps as textures, I suggest looking at the samples in the official Android SDK. This method mainly solves the problem of mixing Android UI content with OpenGL ES 2.0 scenes. There is still a lot you need to build yourself, such a scene graph, handling user input and animations. However, you now have enough to start experimenting and I 'll be posting a follow up on this where we look at how to build a simple scene graph and handling user input. Note: Droidcon Berlin is a two day barcamp and conference that explores all aspects of developing for Android mobile devices. Happening in Berlin at the Urania Berlin on March 23 and 24, droidcon Berlin will host workshops on Android apps and game development. Over 1200 people are participating in this conference ,
sumber http://blogs.sonyericsson.com/developerworld/2011/03/24/3d-for-android/
.semoga bermanfaat,,Maju terus indonesia dan tetap berhati-hati dalam hidup ini,semoga bermanfaat dan sukses semoga ALLAH slalu memberikan yang terbaik selamanya kepada galihrezah dan kekasihnya,,,amin hehehe makasih,,, thanks for visiting this blog and CMIIW (Correct Me If I am Wrong).
Labels
- 5800 (47)
- adobe (1)
- alat hp (7)
- android (5)
- Antivirus (27)
- aplikasi untuk hp symbian uiq (6)
- aplikasi hp java (1)
- aplikasi untuk hp android (1)
- aplikasi untuk hp symbian (31)
- belajar bahasa program visual basic (2)
- blackberry (4)
- bleach (1)
- blog (3)
- browser (7)
- c510i (4)
- c902i (1)
- cedar (12)
- cheat game (9)
- cinta (8)
- crack (26)
- dasar modding (15)
- DB3350 (2)
- ddtank (2)
- dunia hacking (29)
- elm (1)
- facebook (8)
- favoritku (51)
- firmware (1)
- game hp (6)
- game komputer (13)
- game untuk hp cina (1)
- gratisan (16)
- handphone (21)
- hazel (1)
- hp a2 (3)
- hp cina (3)
- humor (1)
- internet (18)
- islami (2)
- j105 naite (2)
- k770i (7)
- k800i (1)
- k810i (4)
- k850i (3)
- komputer (96)
- laptop (4)
- lirik (12)
- modding (114)
- musik (18)
- naruto (1)
- nokia (56)
- office (2)
- one piece (1)
- pack modding (30)
- patch vkp (2)
- patching (4)
- pb (2)
- pengetahuan (33)
- puisi galihrezah (11)
- review (4)
- s40 (5)
- s60v3 (11)
- s60v5 (5)
- screensaver (1)
- screenshoot (4)
- service (56)
- sitemap (1)
- sms (4)
- tema (9)
- Themes Effect (2)
- tool download (1)
- tool edit photo (1)
- tool komputer (23)
- tutorial (74)
- uiq (17)
- ultahku (3)
- untuk tampilan komputer (2)
- virus (3)
- w200i (8)
- W705i (1)
- w910i (6)
- w995i (5)
- walpaper (2)
- warnet (11)
- window (2)
- zylo (1)
Blog archive
-
▼
2011
(491)
-
▼
April
(64)
- cara Install Garmin di Nokia 5800
- cara menjalankan game Ocean Age untuk hp di PC
- tema walkman 3.0 untuk W995i Winamp Pack
- walpaper untuk satio
- pack modding untuk w995i
- pack modding untuk k850i audi tts
- Cara mindahin aplikasi di memory hp
- piterband ada ada aja denganmu
- Maksimal batre edition untuk 5800
- norman cinta rakyat
- Cara Mencabut dan memasang IC
- Acoustic bagus untuk ELM dan zylo (DB3350)
- Cara memasukan firmware photon c6-03 ke hp by gali...
- cara memperbaiki HP yang Boros Baterai
- tutorial memasukan firmware photon c6-03 ke 5800 v...
- photon c6-03 modded by zafael
- photon c6-03 untuk 5800
- Megapack for k770i window 7 edition
- Cara mempercepat start up hp 5800 by galihrezah
- Megapack untuk w910i rifa037 Energi blizt
- Megapack for w705i R1GA031
- Sofware pc untuk edit acoustic hp A2 Acoustic Edit...
- Sofware untuk mengedit skin media player hp a2
- Megapack android for elm
- Mod pack for c510i
- Pembuat Cda untuk hp a2
- Mega pack k770i r8bc004 BlackSky Walkman 4 Edition
- Pack modding for w910i simbyan vista
- Mawar cinta yang kusayang
- A2uploader versi terbaru
- Game keren untuk hp Galaxy On Fire
- Megapack for c902i girl in the fire
- Megapack for hazel
- k800i neon pack modding by galihrezah
- cara mengedit acoustic hp se
- download 3gp kumpulan episode One Piece sampai ...
- download 3gp kumpulan episode Bleach sampai epis...
- download 3gp kumpulan episode naruto Shippuuden sa...
- saran atau kritik komentar juga boleh,kalau reques...
- A new dimension of Android™ – Making a 3D UI for A...
- Front keren untuk k850i dan hp se lainnya
- Driver camera bagus untuk w995i
- Cara Bantu Bersihkan Limbah Nuklir Radiokatif deng...
- Tema keren untuk w960i blackbery version edited by...
- Alunan kata penuh makna dari sahabatku
- Puisi patah hati dari sahabatku
- Trick internetan gratis telkomsel dan gak lelet bu...
- Wina budak saha
- Info Pertandingan futsal
- Tutorial Mengganti Susunan Menu Standar hp se
- Tema keren untuk 5800 black sketch by galihrezah
- Merpati band tak rela
- Download vidio polisi gaul
- Aplikasi keren untuk 5800 nokia batre monitor v1.3
- Tema keren untuk 5800 frourest warna emas by galih...
- Dasar-dasar modding nokia 5800
- Tips untuk pengguna hp uiq
- Sekarang di 4shared.com upload bisa mecapai 2gb pe...
- Cara mengganti front hp nokia tanpa perlu di flash...
- Cara memodding suara hp nokia
- Cara downgrade firmware nokia tanpa membuat hp mat...
- Firmware terbaru untuk 5800 by galihrezah
- Menjajal firmware terbaru w960i by galihrezah
- Mengetes aplikasi google maps versi terbaru v 4.1
-
▼
April
(64)
0 komentar: