How to apply texture image to my 3D model in metaio - android

My texture image (.png file) seems to be ignored somehow and my 3D model (.obj file) is displayed in one colour. Both built in Blender.

It appeared that I haven't included a MTL file in my project...

Related

Why I can't add an .svg file with effects such as drop shadows, blurs, and color matrix in Android Studio?

Why I can't add an .svg file with effects such as drop shadows, blurs, and color matrix as a drawable resource in Android Studio?
Because Android's drawables are not SVG. You can create xml drawables fron SVGs. The format of Android's vector drawablea is similar to SVG, but it is not the same.
If you want all the effects you mentioned, you'll probably have to create bitmap images in various resolutions in a graphics program that fully supports SVG and use those bitmap images (PNG for instance) for your app, putting them in the correct drawables folders.

Android Studio does not import all parts of an SVG Vector

I want to import some vector graphics from illustrator for the design of my android studio app. If I export my vector graphics as SVG, this works wonderfully. All parts of my project are successfully exported and the result is satisfactory (image 1). However, when I create this SVG file as a new Vector Asset in Android Studio, one of my blue circles is suddenly missing (see image 2). What can be the reasons why Android studio does not import all parts of my SVG? Or could the reason be a wrong export from illustrator?
Edit: Added Picture 3 to show what happens if I use a online converter instead. The output is even worse.
Any Help is appreciated!
Picture 1:
Picture 2:
Image 3...Result when I use a online converter to get a xml vector(also wrong)*
The version of the SVG that is displayed in the converter window is rendered by a built-in SVG renderer in Android Studio. It's a preview of the SVG. It does not necessarily reflect what the output of the converter will be.
So the bug you are seeing is with the built-in SVG renderer.
VectorDrawables don't really support gradient fills. At least the converter doesn't support them. So even if the displayed SVG were perfect, the generated VectorDrawable won't include the gradient circles anyway.
So you have a few alternative approaches:
Change your circles to solid fill and then convert to VectorDrawables.
Like #1, but add gradients by using predefined gradient definitions.
Use an actual SVG rendering library (like AndroidSVG) in your app.
Switch to using a bitmap background (ie PNG)
Draw the background yourself using Canvas methods.
Personally, I would go with #3.
Android Studio doesn't convert complex graphics into vector drawable. It only converts flat icons. You have to use a png here dude !!

On loading .obj material make blurr

I am loading .obj file with material file.
I have scale down my .obj like below
mObjectGroup.setScale(.01f);
In Blender it is rendered perfect fine, but when i render it using rajawali some material get blurred.
In Blender it lloks like it
And in android after rendering images get blurred.
As I recall using .obj with materials is a mess! Try exporting as FBX or any other format

Android - Draw on Canvas made from .gif

I have a custom view where normally I was using .png files to draw onto in a canvas and that worked fine but now my requirements are to use .gif files and for some reason the same code will not work. Is there something specific about .gif files that doesnt allow android canvas objects to draw on bitmaps made from them?
Apparently you cannot draw on a canvas created from a .gif file. Once I was able to convert the .gif to .png I was able to draw on the canvas again.
Actually, I can draw GIF files on canvas, but all transparent colours turn into white! I assume it is just a bug, related to the new parameter inPremultiplied in Bitfactory.Options which probably was not tested properly.
I am really frustrated with that, since now I have to replace GIFs by PNG in all my previous applications. (Fixing the bug in the following version doesn't make any difference, since there will still be models, not supporting GIF transparency.)
Indeed GIF file has it own advantage. It doesn't support alpha or true colour, but it has transparent index which in many cases is what actually needed. If you want PNG files to be not crucially bigger in size than GIF (I assume this is the main reason for using GIF instead of PNG), convert PNG files from true color to index (colormap) format (most of graphic editor, including GIMP and Photoshop support that), which works OK with KitKat. You will still lose size, but no mare than 1%.

Android Textures appear unclear/fuzzy

I'm having trouble making my texture rendered correctly in my applications.
the artwork I use is precise and already scaled and the right size but when I render it on phone suddenly my texture are not as clear/precise as the original artwork and I can't figure out why.
has anybody had this issue before?
This is because android will compress all resources that are not placed inside /res/raw/
http://developer.android.com/guide/topics/graphics/2d-graphics.html
Note: Image resources placed in res/drawable/ may be automatically optimized with lossless image compression by the aapt tool. For example, a true-color PNG that does not require more than 256 colors may be converted to an 8-bit PNG with a color palette. This will result in an image of equal quality but which requires less memory. So be aware that the image binaries placed in this directory can change during the build. If you plan on reading an image as a bit stream in order to convert it to a bitmap, put your images in the res/raw/ folder instead, where they will not be optimized.
This might also happen if you use linear filtering in your texture, make sure that texture filters are GL_NEAREST for GL_MIN_FILTER and GL_MAG_FILTER.
Ok I finally figured it out
the problem I was having was coming from the default compatibility mode of android
I had to add this to my manifest

Categories

Resources