Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - oetzi

Pages: [1]
Support / [SOLVED] How to load textures on an OBJ model?
« on: September 27, 2013, 02:19:16 pm »

I am new to this topic and have problems with loading textures correctly onto my 3D object.
What I successfully did so far was to load a 3DS model and to put the textures on it via the TextureManager.

But now I have to use a OBJ model. The background is that I did a 3D scan of my face and got the following files:
- oetzi.obj
- oetzi_MATERIAL.mat
- oetzi_TEXTURE-0.jpg
- oetzi_TEXTURE-1.jpg
- oetzi_TEXTURE-2.jpg

The MATERIAL files contains this:
newmtl material_0
map_Kd oetzi_TEXTURE-0.jpg
newmtl material_1
map_Kd oetzi_TEXTURE-1.jpg
newmtl material_2
map_Kd oetzi_TEXTURE-2.jpg

So I changed the Loader.load3DS(...) method to Loader.loadOBJ(InputStream objStream, InputStream mtlStream, float scale).
My first attemp was to set the 2nd paramter to null and to keep the approach to load the texture first into the TextureManager and then use "obj3D.setTexture("material_0")". The result was that my 3D model was displayed but the textures were a total mess.

Then I thought that there might be a reason, why loadOBJ has this second inputStream called mtl :-)
So I tried to load this .mat file as second inputStream
Code: [Select]
inputStreamMTL = masterContext.getAssets().open("3d-objects/oetzi-obj/oetzi_MATERIAL.mat");and used it as second paramter for the loadOBJ() method.

Unfortunately, I do not know what I have to do now in order to get the textures onto the 3D model. All I tried so far, did not work.

Therefore, I would be grateful to get a brief explanation, how I have to handle the .obj, the .mat and the texture files to get my final 3D model displayed.


Support / Unsupported texture width
« on: August 16, 2013, 04:51:34 pm »

I am very new to the general work with 3D objects as well as to jPCT.
Nevertheless, I got an app running, which displays a 3DS object, which I simply downloaded from (I thought it might be a good idea to start with a very simple 3D object :) )

After being happy about this simple 3D object on my screen I have tried to load the related texture, but failed so far.
The error I get is "ERROR: Unsupported Texture width: 800"
I found several posts in this forum which deal with similar issues, but most of them were related to the use of drawables, which is not applicable for my case.

Code: [Select]
inputStream = masterContext.getAssets().open("3d-objects/ball/Ball N280313.3DS");
Texture texture = new Texture(masterContext.getAssets().open("3d-objects/ball/main_product_133750009413897300.jpg"));
TextureManager.getInstance().addTexture("main_product_133750009413897300.jpg", texture);

So, could anyone tell me, what I am doing wrong here?


Pages: [1]