On loading .obj material make blurr - android

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

Related

Use complex SVG in android studio

I have a SVG file of a map. I can't convert with android studio I have this error : error while parsing svg .
I already convert it into png file but the quality deteriorates.
Or is it possible to convert .SVG to a list of draw functions with canvas.
Your text overlay contains characters that aren't UTF-8, which is typically the default if not specified.
This character is the first culprit รข
Put this at the top of your svg document.
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
This may work in Android and it may not, but its a starting point. The first thing I would try to do is cut-up the SVG into smaller pieces and load it in square chunks because is huge. Its better to draw 30 smaller things than 1 big thing because you're suffocating the UI thread if you try to do it all at once.
Also Text in general doesn't seem to be support in the Android Studio importer
Last thing on the page ->
https://developer.android.com/studio/write/vector-asset-studio

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 !!

How do I render an SVG in an Android app?

After finding Display SVG Image in image view in android on Google and going to Having issue on Real Device using vector image in android. SVG-android, I find that "You need a 3rd-party JAR to do it" is a bit of overkill. Is there any way to render an SVG without using 3rd-party libraries?
I managed to display an SVG using a WebView, since that is more than capable of rendering an SVG:
webView.loadUrl("file:///android_res/drawable/file.svg"); // point it to the SVG
webView.setBackgroundColor(0x00000000); // set the background to transparent
This makes it render much like a transparent PNG would in an ImageView. The only caveat is that the SVG must use the viewBox attribute and not use the height or width attributes, to ensure it resizes properly.
Using custom fonts actually works really well in Android.
You can use the free icomoon web application to convert SVGs to custom .ttf font characters.
If you are using it for imagePicker sort of feature then,
webView.loadURl(selectedFileLocation.toString)
else if it is to display a .svg image from web,
webView.loadURl(/*url for the .svg file*/)

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

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...

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%.

Categories

Resources