Main Menu
Menu

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.

Show posts Menu

Messages - thrysyuk

#1
Yeah, this is really specific for the Photoshop. This feature is too limited.
Thanks a lot for the help. I really appreciate your efforts.

Best regards,
Taras
#2
Thanks for helping me :)

i applied new jar, set name of the texture:

TextureManager.getInstance().addTexture("Layer 0.JPG", texture);

The texture is shown now, but not applied onto the object.
It looks like this: http://sharesend.com/07p54

It seems those -s and -o and coordinates near them: "-s 0.465376 0.988734 1.0 -o 0.238287 -0.002412 1.0" are the coordinates/instructions how texture should be applied.

Does it make sense?

BTW, maybe there is another way for creating such type of objects without using Photoshop Repousse? are you aware of any?
Is there any possibility in jPCT to make such objects in runtime?

Thank you.
Taras
#3
Thank you a lot.
Do you know maybe some different tools that might do the same thing without those -s and -o?
The idea is to have an object like this one: http://sharesend.com/fno4v.
#4
Here is a model http://sharesend.com/6c24n. Please let me know if you need any assistance from my side.

Thank you a lot.
Taras
#5
Well, when i applied next changes to code:

Texture texture = new Texture(BitmapHelper.convert(getResources().getDrawable(com.threed.jpct.example.R.raw.front)));
TextureManager.getInstance().addTexture("-s 0.465376 0.988734 1.0 -o 0.238287 -0.002412 1.0 Layer 0.JPG", texture);

here's what i got: http://sharesend.com/07p54. The texture was applied, but incorrectly.
#6
Thanks for the reply.
the object was created using Photoshop Repousse. Please find attached .mtl file of my object that contains references to textures.
i also checked logs and found one interesting thing:
05-20 21:03:30.427: I/jPCT-AE(386): Texture named -s 0.465376 0.988734 1.0 -o 0.238287 -0.002412 1.0 Layer 0.JPG added to TextureManager!
Looks like jPCT doesn't recognize coordinates of vertixes from textures or something like this.
Also the next log record
05-20 21:03:52.697: I/dalvikvm(386): Jit: resizing JitTable from 512 to 1024
looks strange. the size of the Layer 0 texture is 512 and according to that record we are trying to stretch the texture to 1024. Could this cause the issue with not applying texture?

Here's the full log of loading of the object:

05-20 21:03:30.407: I/jPCT-AE(386): Loading file from InputStream
05-20 21:03:30.407: I/jPCT-AE(386): Text file from InputStream loaded...1185 bytes
05-20 21:03:30.417: I/jPCT-AE(386): Processing new material Layer 0 Front Inflation Material!
05-20 21:03:30.427: I/jPCT-AE(386): Texture named -s 0.465376 0.988734 1.0 -o 0.238287 -0.002412 1.0 Layer 0.JPG added to TextureManager!
05-20 21:03:30.437: I/jPCT-AE(386): Processing new material Layer 0 Front Bevel Material!
05-20 21:03:30.467: I/jPCT-AE(386): Processing new material Layer 0 Extrusion Material!
05-20 21:03:30.497: I/jPCT-AE(386): Processing new material Layer 0 Back Bevel Material!
05-20 21:03:30.507: I/jPCT-AE(386): Processing new material Layer 0 Back Inflation Material!
05-20 21:03:30.517: I/jPCT-AE(386): Loading file from InputStream
05-20 21:03:30.527: D/szipinf(386): Initializing zlib to inflate
05-20 21:03:30.717: D/dalvikvm(386): GC_CONCURRENT freed 1641K, 35% free 8230K/12487K, external 4812K/8908K, paused 6ms+5ms
05-20 21:03:30.817: D/dalvikvm(386): GC_FOR_MALLOC freed 1296K, 33% free 8380K/12487K, external 716K/4812K, paused 48ms
05-20 21:03:30.817: I/dalvikvm-heap(386): Grow heap (frag case) to 12.228MB for 840004-byte allocation
05-20 21:03:30.887: D/dalvikvm(386): GC_FOR_MALLOC freed 2K, 31% free 9198K/13319K, external 716K/4812K, paused 54ms
05-20 21:03:30.997: D/dalvikvm(386): GC_FOR_MALLOC freed 1460K, 36% free 8653K/13319K, external 716K/4812K, paused 52ms
05-20 21:03:31.157: D/dalvikvm(386): GC_CONCURRENT freed 1563K, 32% free 9117K/13319K, external 716K/4812K, paused 5ms+4ms
05-20 21:03:31.257: D/dalvikvm(386): GC_FOR_MALLOC freed 603K, 32% free 9063K/13319K, external 716K/4812K, paused 39ms
05-20 21:03:31.267: I/dalvikvm-heap(386): Grow heap (frag case) to 13.896MB for 1889998-byte allocation
05-20 21:03:31.357: D/dalvikvm(386): GC_FOR_MALLOC freed 1K, 29% free 10907K/15175K, external 716K/4812K, paused 78ms
05-20 21:03:31.477: D/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol
05-20 21:03:31.637: D/dalvikvm(386): GC_CONCURRENT freed 3261K, 38% free 9714K/15623K, external 716K/4812K, paused 7ms+5ms
05-20 21:03:31.707: D/dalvikvm(386): GC_FOR_MALLOC freed 69K, 39% free 9677K/15623K, external 716K/4812K, paused 60ms
05-20 21:03:31.747: I/dalvikvm-heap(386): Grow heap (frag case) to 15.397MB for 2834992-byte allocation
05-20 21:03:31.868: D/dalvikvm(386): GC_FOR_MALLOC freed 0K, 33% free 12445K/18439K, external 716K/4812K, paused 107ms
05-20 21:03:32.067: D/dalvikvm(386): GC_CONCURRENT freed 3532K, 41% free 10911K/18439K, external 716K/4812K, paused 4ms+6ms
05-20 21:03:32.177: D/dalvikvm(386): GC_FOR_MALLOC freed 1433K, 43% free 10603K/18439K, external 716K/4812K, paused 49ms
05-20 21:03:32.227: I/dalvikvm-heap(386): Grow heap (frag case) to 17.653MB for 4252484-byte allocation
05-20 21:03:32.317: D/dalvikvm(386): GC_FOR_MALLOC freed 2K, 35% free 14753K/22599K, external 716K/4812K, paused 75ms
05-20 21:03:32.487: D/dalvikvm(386): GC_CONCURRENT freed 4360K, 48% free 11967K/22599K, external 716K/4812K, paused 5ms+7ms
05-20 21:03:32.537: D/dalvikvm(386): GC_FOR_MALLOC freed 4K, 48% free 11962K/22599K, external 716K/4812K, paused 51ms
05-20 21:03:32.547: I/dalvikvm-heap(386): Grow heap (frag case) to 18.101MB for 3329602-byte allocation
05-20 21:03:32.647: D/dalvikvm(386): GC_FOR_MALLOC freed 0K, 33% free 15214K/22599K, external 716K/4812K, paused 69ms
05-20 21:03:32.687: I/jPCT-AE(386): Text file from InputStream loaded...1664793 bytes
05-20 21:03:33.027: D/dalvikvm(386): GC_CONCURRENT freed <1K, 33% free 15214K/22599K, external 716K/4812K, paused 22ms+6ms
05-20 21:03:33.189: D/dalvikvm(386): GC_FOR_MALLOC freed 4160K, 52% free 11053K/22599K, external 716K/4812K, paused 58ms
05-20 21:03:33.198: I/dalvikvm-heap(386): Grow heap (frag case) to 17.213MB for 3329636-byte allocation
05-20 21:03:33.277: D/dalvikvm(386): GC_FOR_MALLOC freed 0K, 37% free 14305K/22599K, external 716K/4812K, paused 58ms
05-20 21:03:33.477: D/dalvikvm(386): GC_CONCURRENT freed <1K, 37% free 14305K/22599K, external 716K/4812K, paused 5ms+5ms
05-20 21:03:34.097: D/dalvikvm(386): GC_CONCURRENT freed 3251K, 43% free 13101K/22599K, external 716K/4812K, paused 4ms+13ms
05-20 21:03:34.207: I/jPCT-AE(386): Processing object from OBJ-file: jPCT_generated
05-20 21:03:36.338: D/dalvikvm(386): GC_CONCURRENT freed 1370K, 39% free 13810K/22599K, external 716K/4812K, paused 4ms+8ms
05-20 21:03:37.588: D/dalvikvm(125): GC_EXPLICIT freed 100K, 50% free 2930K/5831K, external 2075K/2294K, paused 1339ms
05-20 21:03:38.688: D/dalvikvm(386): GC_CONCURRENT freed 2081K, 39% free 13831K/22599K, external 716K/4812K, paused 4ms+6ms
05-20 21:03:40.677: D/dalvikvm(386): GC_CONCURRENT freed 2106K, 39% free 13838K/22599K, external 716K/4812K, paused 5ms+7ms
05-20 21:03:42.507: D/dalvikvm(225): GC_EXPLICIT freed 491K, 55% free 2598K/5703K, external 716K/1038K, paused 1228ms
05-20 21:03:42.737: D/dalvikvm(386): GC_CONCURRENT freed 2133K, 40% free 13752K/22599K, external 716K/4812K, paused 5ms+7ms
05-20 21:03:44.767: D/dalvikvm(386): GC_CONCURRENT freed 2020K, 39% free 13817K/22599K, external 716K/4812K, paused 4ms+6ms
05-20 21:03:46.547: D/dalvikvm(386): GC_CONCURRENT freed 2116K, 40% free 13749K/22599K, external 716K/4812K, paused 4ms+6ms
05-20 21:03:47.927: D/dalvikvm(386): GC_CONCURRENT freed 2048K, 40% free 13749K/22599K, external 716K/4812K, paused 4ms+7ms
05-20 21:03:49.387: D/dalvikvm(386): GC_CONCURRENT freed 2048K, 40% free 13749K/22599K, external 716K/4812K, paused 4ms+5ms
05-20 21:03:50.647: D/dalvikvm(386): GC_CONCURRENT freed 2047K, 40% free 13749K/22599K, external 716K/4812K, paused 4ms+6ms
05-20 21:03:52.417: D/dalvikvm(386): GC_CONCURRENT freed 2002K, 39% free 13809K/22599K, external 716K/4812K, paused 4ms+5ms
05-20 21:03:52.697: I/dalvikvm(386): Jit: resizing JitTable from 512 to 1024
05-20 21:03:54.147: D/dalvikvm(386): GC_CONCURRENT freed 2108K, 40% free 13749K/22599K, external 716K/4812K, paused 4ms+7ms
05-20 21:03:55.497: D/dalvikvm(386): GC_CONCURRENT freed 2047K, 40% free 13749K/22599K, external 716K/4812K, paused 5ms+6ms
05-20 21:03:56.597: D/dalvikvm(386): GC_CONCURRENT freed 1316K, 37% free 14368K/22599K, external 716K/4812K, paused 4ms+10ms
05-20 21:04:04.637: I/jPCT-AE(386): Object 'jPCT_generated_jPCT0' created using 6362 polygons and 3183 vertices.
05-20 21:04:04.897: D/dalvikvm(386): GC_CONCURRENT freed 6688K, 58% free 9647K/22599K, external 716K/4812K, paused 4ms+5ms
05-20 21:04:05.677: D/dalvikvm(386): GC_CONCURRENT freed 1662K, 56% free 10032K/22599K, external 716K/4812K, paused 5ms+9ms
05-20 21:04:05.797: I/dalvikvm(386): Total arena pages for JIT: 11
05-20 21:04:05.797: I/dalvikvm(386): Total arena pages for JIT: 12
05-20 21:04:06.057: I/jPCT-AE(386): Normal vectors calculated in 1087ms!
05-20 21:04:06.067: I/jPCT-AE(386): Memory usage before compacting: 10541 KB used out of 22599 KB
05-20 21:04:06.187: D/dalvikvm(386): GC_EXPLICIT freed 1216K, 59% free 9325K/22599K, external 716K/4812K, paused 118ms
05-20 21:04:06.257: D/dalvikvm(386): GC_EXPLICIT freed <1K, 59% free 9325K/22599K, external 716K/4812K, paused 77ms


Here is a test object i'm trying to import to Android http://sharesend.com/fno4v so you can see what type of the object i'm working with.

Thank you a lot of your help!
Taras

[attachment deleted by admin]
#7
Hello,

First of all i would like to thank jPCT team for the great work they do. I'm new to jPCT and 3d modeling for android so please do not blame me for my incompetence in possibly obvious things :)
i have a problem with loading my 3d .obj file. Actually it loads just fine, but the main texture is not applied at all.
i've already read the article about correct loading of objects with textures -  http://www.jpct.net/wiki/index.php/Loading_models

Here is a code snippet how i'm loading the object with textures:

Texture texture = new Texture(BitmapHelper.convert(getResources().getDrawable(com.threed.jpct.example.R.raw.front)));
TextureManager.getInstance().addTexture("Layer 0.JPG", texture);
Texture texture1 = new Texture(BitmapHelper.convert(getResources().getDrawable(com.threed.jpct.example.R.raw.edge)));
TextureManager.getInstance().addTexture("Layer 0 Extrusion Material - Default Texture.JPG", texture1);

obj = Object3D.mergeAll(Loader.loadOBJ(getResources().openRawResource(R.raw.jbcut), getResources().openRawResource(R.raw.jbcut_conf), 20));
obj.strip();
obj.build();

world.addObject(obj);



  • jbcut - .obj file
  • jbcut_conf - .mtl file
  • front - front texture of the 3d object. .mtl file maps the texture by name "Layer 0.JPG"
  • edge - back texture. .mtl file maps the texture by name "Layer 0 Extrusion Material - Default Texture.JPG"

texture "edge" (Layer 0 Extrusion Material - Default Texture.JPG) is applied well, but the "front" (Layer 0.JPG) is not applied.
I would really appreciate if you could give me some suggestions how to fix this. Please let me know if you need any other info (files from me to examinate the issue).

Thanks for the help beforehand.
Taras.