Is there at least some way to get a picture of a .obj model without displaying the model ?
I have a lot of .obj models and I need to convert them to .png images.
I need only image without display anything
You don't really need libgdx for obj rendering. This can be done by either opengl, or some custom render libs.
Consider using this library written in c++ for obj rendering. Here's its description in russian
Do you need to do this in libgdx? I think you can also call blender via command line, let it render the scene and output to an image. Make a short bash script to do this for all .obj files in your folder.
If you do need to use libgdx, I think a good approach is to render to a framebuffer, then write its contents to a file.
Related
I am having success converting .usdz models to .dae using Xcode. However I eventually want the file formats to end up as .glb / .gltf.
I'm using blender to encode .dae into .glb, also a tool made by Khronos group here. https://github.com/KhronosGroup/COLLADA2GLTF
The problem is that the Xcode .dae output is a .dae file and a folder of .png texture files. Xcode can read this just fine and reconstitute the original .dae however blender seems to be incapable of using these texture files and same with the Khronos CLI converter. Using these tools, the .dae shows up without textures, colorless and only constituted in shape based on 3D coordinates.
Does anybody know how to use this folder of texture .png files to render color to a blender .dae?
Ultimately I want to convert .usdz to .glb / .gltf and this is the way I have found, but I'm running into this hiccup. Google search did not improve the hiccup, hence my question here.
I've been experimenting and have found another way you can possibly do the conversion to GLB outside of Blender. Basically, as you have found you convert the .usdz to .dae using Xcode - which results in a .dae file with a folder of textures (.png's). If you now zip the file and the folder together - rename the .zip file ending to .zae. Now take this .zae zip file and go to https://products.aspose.app/3d/conversion you can convert the zip file to GLB. Once you have the GLB file, test it out in Scene Viewer and you should now have the colours, textures etc. on the model. I have had a few issues on one model, namely not all the textures seem to be there, majority are but a few more detailed elements are missing. ie. I have a 3D Framed Artwork model, the black shiny frame, the brown paper backing, and the art colour background are fine but the details of the artwork are missing! Very weird. The Artwork itself is just in one texture file as a .png together with the other files for metallic, colours, etc. and it shows correctly in photoshop or viewer. Also the DAE file shows correctly in preview. Just when it's all brought together in GLB it is missing some detail. Kind of 80% sorted though. Hope this is of help!! And I also hope I have saved another fellow human being from tearing out the remainder of their hair...lol
I am using matplotlib to draw a graph using some data and I have saved it in Pdf format.Now I want to add a logo to this file.How can I do this.
Thanks in advance
If you can do it the other way round, it is easier:
plot the image
load the logo from file with, e.g. Image module (PIL)
add the logo with plt.imshow, use the extent keyword to place it correctly
save the image into PDF
(You may even want to plot the logo first, so that it stays in the background.)
Unfortunately, this does not work with vector graphics, but as logos usually are not that large, you may use a .png or even a .jpg.
If you already have the PDF's then this is not a matplotlib or python question. You need some PDF editing tools or libraries to add the logo. Possible, but an entirely different thing.
I opened one PNG file in Inkscape and exported it as SVG. When I opened that file with notepad I came to know that the PNG file is embedded within it. If the conversion happened then the resulting file should have only SVG related tags. It shouldn't embed the image within it. Or Am I doing anything wrong.
Note: Save as option also producing the same kind of file. I am using Inkscape version 0.48 in Windows 7 - 64 bit.
This is a bit of an old thread, but it comes up early in Google so I thought I'd contribute something.
In Inkscape, you must do a trace to change the image into SVG. Look at the Path | Trace bitmap menu item and play with the options on that screen.
After creating the trace, you can remove your source image and have a pure svg in your saved file.
I've found it helpful to create layers in Inkscape and move the source image to one layer and put the trace on another layer to let me make quick comparisons using the 'hide layer' buttons.
BTW, your source image can be anything - bmp, jpg, png, etc.
A .png file is a raster image file. In order to convert it to a vector graphic based format like .svg and have it be "native" svg rather than an included image you are going to either have to use a program that can rasterize it or in Inkscape trace the bitmap and turn it into paths. Inkscape provides information on tracing: http://inkscape.org/doc/tracing/tutorial-tracing.html
I'm playing a bit with LibGDX (OpenGL ES 2.0 wrapper for Android).
I found some sample code which used prepared files to load models and mipmap textures for them, e.g., at https://github.com/libgdx/libgdx/blob/master/demos/invaders/gdx-invaders/src/com/badlogic/gdxinvaders/RendererGL20.java it reads .obj file for the model and RGB565 format .png file to apply a mipmapped texture to it.
What is the best / easiest way for me to create these files?
I understand .obj files are generated by a bunch of tools (I installed Blender, Wings3D and Kerkythea so far), but which ones will be the most user friendly for someone unfamiliar with 3D modelling?
But more importantly, how do I produce a .png file with the mipmapped texture? The .png I looked at ( https://github.com/libgdx/libgdx/blob/master/demos/invaders/gdx-invaders/data/ship.png ) seems to include different textures for each of the faces, probably created with some tool. I browsed through the menus for the 3 tools I have installed but didn't find an option to export such a .png file. What am I missing?
Is there an easy way to render an SVG-image resulting in an image-object or a bitmap byte-array (Not saving the file in another type but just put it as an image in main memory)?
You could have a look at Mono.Cairo, which is a low-level vector library for Mono. Here is an example for loading images, including SVG.