Converting Collada file to a a3d (Android3d) object
Asked Answered
M

4

8

I am looking into Renderscript capabilities and stuck with the A3D (Android 3d) file format. I can't find an easy way to convert a Collada file into an A3D format to store my blender model.

I was wondering if you guys have an idea I could try maybe?

Does anyone have a working code sample so that is can see what im doing wrong?

More info: http://developer.android.com/reference/android/renderscript/FileA3D.html

Edit: Not to be mistaken for the Asci3d file extention ( also *.a3d )

Moyer answered 26/4, 2011 at 10:57 Comment(0)
C
6

As of Ice Cream Sandwich (perhaps earlier) there is a tool in the Android source to convert between Collada and A3D.

The tool is called a3dconvert; you can browse the source online here (in the ICS branch): https://github.com/android/platform_development/tree/ics-mr1-release/tools/a3dconvert

Usage: a3dconvert input_file a3d_output_file Currently .obj and .dae (collada) input files are accepted.

This tool has been removed as of newer releases (Jelly Bean, it looks like). This probably because the graphics portion of Renderscript has been deprecated.

Cutie answered 1/2, 2012 at 22:9 Comment(2)
Unfortunately this doesn't come installed with the Android SDK, and the AOSP source does not build on Windows. I still need to figure out if is it possible to build just this tool on Windows.Cutie
2 thekidder. Do you mean, it's building on other platforms? How did you manage a3dconvert to compile and work?Deme
T
2

I'm not sure A3D is a good format but if you have to write a converter here is a description of both formats:

http://scorpion.tordivel.no/help/UsersGuide/General/ImageOperations/ImageFormats/ImageFormats_a3d.htm

http://en.wikipedia.org/wiki/COLLADA

And here is some sample code to read Collada:

http://sourceforge.net/projects/colladaloader/

Tannatannage answered 30/4, 2011 at 2:48 Comment(1)
I believe ASCII 3D format (which has same .a3d extension as well) is different from Android3D format. At least the data in Android3D is stored in different from plain text way, as in ASCII 3D.Moyer
L
0

If you're going from Blender to A3D, I would consider writing a Python script to go directly to A3D format from Blender. The A3D format seems rather simplistic and if you're only accessing the Mesh data, the Blender API isn't too hard to follow. Of course if you don't already know it, you'll have to pick up some Python syntax.

I knew nothing of Python when I first wanted to pull some information from Blender myself, and looking at existing .py scripts (like the OBJ export), the Blender API and learning some basic Python syntax I was able to write my first (rather simple) script in just a few hours or so.

Luther answered 3/5, 2011 at 17:34 Comment(2)
Seems to be a plausible approach :-) have you found any documentation on how a a3d file is made ? ( Syntax wise an all )Moyer
If, as you mentioned in the comments to Ed's response... if the A3D format is different from the ASCII 3D format... I'm not sure where to start. Googling FileA3D hasn't gotten me anywhere...Luther
M
0

http://colladablender.illusoft.com/cms/ is a project making a plugin for Blender to read Collada directly.

Also, Carrara could be used to convert your files to something Blender supports.

Mudstone answered 5/5, 2011 at 12:35 Comment(1)
I don't think this has anything to do with loading a Collada file into an Android (renderscript) application in a .a3d formatMoyer

© 2022 - 2024 — McMap. All rights reserved.