I am trying to find some very basic tutorials like how to draw a line, how to draw a triangle, how to draw a rectangle etc using OpenGLES in android. All the tutorials I found are in Java but I am looking for C++ based samples. I'll be very thankful if someone can point me to such tutorials.
Update
I am creating activity and renderer in Java but I want to implement/redirect methods like OnDrawFrame, OnSurfaceChanged and OnSurfaceCreated in/to C++.
I would advise to first learn OpenGL (2.0+) on the desktop and then move to OpenGL|ES. As a beginner you are bound to make mistakes and it will be easier to find, fix and learn from them as well the theory and requirements of 3D rendering. When you have a firm grasp you could make the jump instantly into OGL|ES with just the reference pages at hand.
For a crash course though, this book and that have proven quite useful.
Actually this question is asked earlier..
OpenGL on Android using C++ only
may be its useful for you..
But the correct approach is first learn opengl because opengles is like a subset of opengl.
here a link for a good book http://www.amazon.com/OpenGL-SuperBible-Comprehensive-Tutorial-Reference/dp/0321712617/ref=sr_1_2?s=books&ie=UTF8&qid=1318312610&sr=1-2
Related
I am trying to find approaches on stamping multiple textures on an object (3D .obj) Android. But, I am unable to do so, I have tried min3d but not sure if it is the right way to do it?
Is there anything available around which is similar to this? Or How Should I approach this UI? Below is the UI of model and how I want to stamp an "image"/texture on it, in addition I want to change the color of the model / add text on it.
In addition, I am planning to give touches on it, by stamping username/label/textview at the back of the model by using rotation through touches.
Please guide, which SDK should I use on Android, what is the best approach to do it.
What you want is basically just rendering textures on a given 3D mesh, as far as I can see. You could take multiple approaches for this: The simplest being just texturing the actual object, but a more complicated approach could involve rendering the object and "stamp"&text textures separately, giving the illusion of being overlayed (Not preferable though, as this will be difficult to manage correctly).
For texturing, you can either attempt rendering different textures after each other (First the background, then the stamp, then the text), or combining the different elements into one texture (pre-processing) before rendering.
I recommend having a look at the following posts and articles:
OpenGL ES (which can do everything you want to do, but has a decently steep learning curve)
Switch to a different 3D rendering engine if you find it too difficult to use your current one (Many options, although most are fullblown game engines)
Loading 3D objects and textures for OpenGL ES rendering
Check out the following git snippets and articles on texturing in min3d: this, this article, this article on object loading
You did not provide any code displaying your current attempts, so it is difficult to say what exactly your problem is, and how to solve it. If you edit your question you might receive more concrete solutions besides just links to potentially helpful resources.
Perhaps working with the OpenGL ES 2.0 api might be an option. Take a look this repo here called the Android 3D Model Viewer which makes use of it, it might help you out.
After doing android programming for over a year, I think it's time to notch up things a little bit and what is a better way than OpenGl.
I would like to know which version of OpenGL ES should I learn, as I am a complete beginner.
I just started to learn Open GLES on Android (with no experience of Open GL before). I wasn't that interested in learning Open GLES, just getting my graphics to work (to set up a coordinate system and to draw images on it).
I read that it would be easier to learn GLES10 than to learn GLES20, so I went with GLES10. However, drawing an image in Open GL turned out to be a much more complex operation than I expected, and I thought that if I were going to learn all this, I might just as well learn GLES20, so I changed to that instead.
There aren't that many simple tutorials showing you how to draw images in Open GLES. Android's tutorial is quite bad. The code they show on the page is not the same as the code in the "Download the sample" link, the author of the tutorial seem to have made some mistakes, and it doesn't show you how to draw an image. Instead I would recommend this tutorial, although it's not as good as what I was looking for.
I know that my text doesn't answer your question, but I'm just sharing my thoughts in case you find them useful.
Your question should be closed since the answer to it would be completely subjective. Where it comes to the ES version there is no "better", only "better for your needs". I suggest you pick either ES1 or ES2.
There is a huge difference between the ES1 and the ES2 where the ES1 is still using a fixed pipeline and the ES2 is not. What that means is you will have to learn shaders in order to use ES2 and a lot of very handy tools such as a matrix stack are removed in ES2 due to the shaders. There are other libraries replacing those functionality but you still do need to understand them a bit more then in fixed pipeline.
So the ES1 is probably much easier for a beginner since you can have a nice drawing in a very short time but you will want to migrate to higher versions as quick as possible at which point most of the ES1 stuff will be useless to you. The ES2 can be a real pain to begin with and once you understand how things work you have quite a lot of power working with it, still that might take quite some time.
Also most of the current topics considering the openGL and the Android are targeting the ES2 version which means you will have most updated sources around the web.
Still in the end the choice is yours. I know I have not given you the answer but still I hope this helps you understand a bit what you are working with.
I am a developer in Korea.
English not good. Please note the benefits.
I would want to find an example of how to display the text using the texture of OpenGL ES for Android.
I did look at the reference material on the Internet, but most intermediate process is omitted or, methodology has been described.
We would like to try to learn to imitate to see the code written in full and sample a little harder to see me immature is still merit.
We also recommend a example very simple. Driving try once, I want to see to understand by looking at the code.
Have a good day~.
You can use this Rajawali library.. It has very good examples of displaying text using texture..
My thesis is to create an 3D android game. I have installed the 3D softwares like 3DS Max, ZBrush, Blender. I also downloaded Android SDK for Windows and I have Eclipse Juno. But I don't know how to start. Thank you in advance. :)
If you want to write a game, use a game engine.
I would advice against using OpenGL directly if you want to focus
on game mechanics or story. 3D game engines like
Unity or JMonkeyEngine
give you all the tools you need to turn your 3D assets into a game:
Importers for various file formats, a scene graph,
math libraries, and usually tons of example projects that get you
started quickly.
If you want to write a rendering engine, use OpenGL
With OpenGL you can build everything mentioned above yourself: Write
or find importers for your assets, figure out a lighting model, write
a scene graph. If you want to do all that, cool, use OpenGL. But
doing this technical stuff will keep you busy; you will have less time
to make a really great game.
I prefer OpenGL ES for Android. Good performance and easy enough to learn.
It's better to start from basic with opengl and then understand concept of using 3d and then prefer standard tool to use.
I have listed android game engine tool for 2d and 3d. Hope it might help u.
https://stackoverflow.com/questions/17163446/what-is-the-best-2d-game-engine-for-android/17166794#17166794
Start with unity3d which is a game engine, I am not sure but the names that you have posted are used for making 3d models for the game.
Your Thesis? That's pretty broad scope! :)
What I would be looking for, is something with lots of example code (since you say you don't know where to start) and good community involvement (ditto the start thing).
If you only need a single player setting, then I would suggest libGDX as a place that would be a good jumping off platform, as there are lots and lots of step thru tutorials along with lots of example code (and a very up to date wiki on the API), and a pretty good group at helping out with issues.
Since it is open source, you can dig as deep as you want into the inner workings to understand (or be mystified like me) as to how the code is accomplishing whatever task you are looking at. (which might be handy for your thesis)
While it might not be quite as polished as some other commercial 3d development kits, the BadLogic crew has made some very big progress the past few months on the 3d side of the house, along with breaking my JSON code... thanks! :) )
Ok my question is simple:
How do I start working with 2D graphics on android? Untill now,I found on the how to make almost anything on Android,however with graphics I see is harder.
On the android sdk website,I get some simple codes that don't really help me,and I also searched for a book,guess what,I didn't find one that actually shows you how to make a little game explaining me what does every line of code.
So: How do I start working with 2D graphics? I'm interested because I want to make some games.I would be very happy to find a tutorial for ex. that shows you how to make a little character that just jumps over a box.I know you need an engine and all that stuff,and I would actually want to learn how to make a little engine.
libGDX runs on Android (and a few other platforms) and provides high level 2D graphics features like sprites, fonts, tile maps, particles, etc.
Tutorials here.
A few complete demo games with source code here.
Here's a whole series that seems pretty decent, and starts from the beginning.
Also, the techniques of "generic" 2D programming apply, so general-purpose game engine information is useful as well.
If you are interested in android games(2d), I recommend this book http://www.amazon.com/dp/1430230428/
The following book is very good for learning 2d graphics in Android.
"Android 2D graphics with Canvas API".
http://www.amazon.com/Android-Graphics-Canvas-API-ebook/dp/B00DKIAVK8/ref=sr_1_8?s=books&ie=UTF8&qid=1374420538&sr=1-8&keywords=android+2d
It is not for game developers though.
It teaches how to use graphics primitives and work with different coordinate systems. It also has a chapter on multithreading.
It has many simple examples good for beginners.