Make Vertes,TexCoords,Norms and Indices vuforia - android

I use of Vuforia sdk for AR in android.
I make 3d file with jpct(obj file,mtl file and png file),i add these file on my project,how can i make my object 3d object file(like teapot class) for set Vertes,TexCoords,Norms and Indices in vuforia.
Thanks

This has nothing to do with vuforia, per se.
Qualcomm uses a simple renderer for their demos, for convenience and so they can have something to display. There are many possible ways to render an obj file, but there is nothing special about their approach. I do not recommend using that approach in your code: rather, a quick search will show you a variety of much more capable 3d model loader/renderers for android. You should use one of those, it will be better for you in the long run.
If you you are dead-set on using their code, look at the code that renders the teapot, it should be obvious how the data in the teapot class is used.

Related

Show text in android with native c++ without 3rd party

I am searching for a possibility to show text without 3rd party libraries (e.g. freetype) to show text in native c++ on Android. (By the way... I am no Shader expert)
Assuming you are using OpenGL ES 2 or above, you will need to write a very basic shader. Even if all it does is read the texture. There should be enough samples on Github to find something basic. Or checkout Shadertoy.com.
What you want is a Bitmap font. Try a font generator like this one, read in the font descriptor, set the image plane as the texture and draw strings by grabbing the source rects. http://www.angelcode.com/products/bmfont/
LibGDX also has a font generator and even though it's written in Java, the shaders are embedded in the code for rendering.
Even if you did use freetype or stb_truetype, you would still only get images planes and character descriptors (glyph source rects). You would still need to do a lot of font rendering.
Check stb_trutype for some basic examples, I think they are very minimal as far as writing shaders and composing strings into geometry.

The size of Graph file(.pb) from Tensorflow is too large for android Usage, how to reduce it?

I try to build a network implementing the Yolo Object detection using tensorflow, and I want it could be used on Android. After building the structure, I use the tf.train.write_graph to get the graph file and want to replace the original file in android demo.
But the pb file is too large (1.1G) which is not usable on Android. So, how could I reduce the size?
I would suggest you to first try quantizing your graph, for that you'll only need an official TensorFlow script. Here's a great tutorial by Pete Warden:
https://petewarden.com/2016/05/03/how-to-quantize-neural-networks-with-tensorflow/
In theory if you used 32 bit floats your model is going to end up ~4 times (~250Mb) smaller since the values in the graph will be converted to 8 bit integers (For inference it has no significant effect on the performance). Note that this comes into play when you compress the Protocol Buffer file.

Blender And Vuforia

Is there a way to open the Vuforia AR sample packages in blender. I know Vuforia AR has a sdk for Unity 3d, but I am currently using Blender and don't wanna drop $400 to just get the Android license for Unity. Any help with this would be great.
Blender is a 3D modeling software and Unity 3D is a game engine. They are totally different and are made for different purposes. If you want to tweak the sample apps with your own customization, I would recommend using Vuforia SDK for Android. But that includes coding as opposed to Unity which is just drag and drop for simple apps.
Rather late on this one, but I have just written a parser of Wavefront OBJ files to Vuforia's format - the other way round to what thechrisberry wants. Credit to stackoverflow doyen rodrigo-silveira for giving the initiating idea.
The Vuforia samples have basically simple object models - cubes and teapots - so it shouldn't be difficult to make an OBJ file out of them and import this to Blender. You would just have to convert the vertices, normals, texCoords and indices arrays of Vuforia's samples to the OBJ text format (v, vn, vt and f elements), and include the PNG texture file from the sample.

Rendering exported 3D objects on Android using min3D

I'm creating a bike racing game for Android. I am planning to create models in Blender, export them to .obj format and then render them on the device. I'm using the min3D framework to do the obj parsing and rendering. I followed the tutorial in this page for parsing the obj file and to render it on the screen. When I tried simple object like a cube, everything works fine and it is rendered perfectly on the screen. But when I tried to load a simple bike model I downloaded from the web, it doesn't work. The app crashes and I force stop it. When I saw LogCat, it was either a java.lang.NumberFormatException, or java.lang.NullPointerException or a resource not found exception inside the parse() method. I have no clue why this happens.
I have the following doubts about where it possibly could have gone wrong:
1) According to the given tutorial, I changed the file names from .obj and .mtl to _obj and _mtl. But there was a line in the obj file that has the name of the .mtl file. I changed it to _mtl. Still it dint work. Is there something similar I need to do anywhere else? Do I need to modify any of the files in any way?
2) Sometimes I find that models created in Blender 2.49 are parsed and rendered but the models created in Blender 2.6 are causing this trouble. Also min3D was created during the older versions of Blender. So should I use only Blender 2.49 for creating the models and rendering them?
P.S: I'm completely new to graphics so I'm fighting a lot with this without giving up. Any help would be greatly appreciated. :)
I believe this is because of missing Texture. Did you copy the texture image into res/drawable folder?

2D tile game map storage

I'm new to game programming, and am trying to write the Map storage portion of my 2D tile based game on android. At first, my plan was to store the maps in XML. I found a tool (http://www.mapeditor.org/) that stores the created maps in a format close to what I was thinking. However, it seems like Android is very limited when it comes to XML. I'm used to working with XML Beans which doesn't work on Android, though I admit XML Beans would probably be too resource heavy for mobile devices anyways. However, after searching around for XML parser options, it seems like even basic XML validation isn't even included by default with the Android SDK. It's starting to look like XML might not be the best answer.
Does anyone know of a good standard way to store map configuration besides XML? Or some strong XML tools available in Android that handle validation (against a defined schema), and preferably simple parsing? I would really like to avoid defining my own flat file text format for maps...
Check out AndEngine. If I remember correctly AndEngine already has the classes needed to load a map from an XML file for rendering.
As far as a standard way to store map configurations, I would say XML is the way to go. I mean you could create your own format, but why re-invent the wheel?
I parse XML in Android with javax.xml.parsers.DocumentBuilderFactory and various other XML parts. It hasn't failed me yet!
For example see: http://www.developerfusion.com/code/2064/a-simple-way-to-read-an-xml-file-in-java/

Categories

Resources