[Fixd]Issues with Wings3d .obj files not rendering correctly

Anything libgdx related goes here!

[Fixd]Issues with Wings3d .obj files not rendering correctly

Postby tamas305 » Wed Dec 22, 2010 8:26 pm

ship2 wings.png
ship2 wings.png (112.92 KiB) Viewed 9666 times


Above is a terrible ship that I made in wings3d in like 3 minutes. The forum doesn't allow me to upload .wings so I uploaded it to here http://www.mediafire.com/?gj7a8ruepq4wet7 (I hope it works :) ).

This leads me to my problem. All of my meshes render correctly but their textures don't line up when in Gdx Invaders. The above image would appear in the same shape but smoothed, and no texture.

When exporting to .obj, I made sure that triangulation was selected and made the default texture file type a .png. Export UV coordinates was checked, as was export normals.

I am using a newer version of wings (1.2 vs. 1.0.1).

Any ideas why this maybe happening?

Appreciate the help,
-Tamas
tamas305
 
Posts: 108
Joined: Sat Nov 06, 2010 1:51 pm

Re: Issues with Wings3d .obj files not rendering correctly

Postby mzechner » Wed Dec 22, 2010 10:20 pm

flip your texture on the y-axis. we'll rewrite the obj loader and give you a way to specify whether the uvs should be flipped or not so that you don't have to invert your texture image.
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: Issues with Wings3d .obj files not rendering correctly

Postby tamas305 » Wed Dec 22, 2010 11:05 pm

Unfortunately that didn't do it. It still looks like this...

device3.jpg
device3.jpg (65.75 KiB) Viewed 9652 times


even when I flipped it...

ship2.png
ship2.png (4.04 KiB) Viewed 9652 times
tamas305
 
Posts: 108
Joined: Sat Nov 06, 2010 1:51 pm

Re: Issues with Wings3d .obj files not rendering correctly

Postby mzechner » Wed Dec 22, 2010 11:36 pm

I downloaded your .wings3d file and your flipped texture from your last post. I exported an OBJ file from Wings3D (triangulated). I then loaded both files in ObjTest.java. Here's the output on Android:

objtests.png
objtests.png (18.89 KiB) Viewed 9649 times


That looks pretty much as expected. Since the ships in your image above are all white it indicates to me that the texture is not loaded correctly. Double check that.
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: Issues with Wings3d .obj files not rendering correctly

Postby tamas305 » Thu Dec 23, 2010 12:03 am

I put everything in ObjTest.java as well and I am getting that white version again. How would I check if my texture loaded correctly?

I added the .png and the .obj to assets in the gdx-test-android folder and changed the following lines of code.

Code: Select all
mesh = ModelLoader.loadObj(Gdx.files.internal("data/ship2.obj").read());
texture = Gdx.graphics.newTexture(Gdx.files.getFileHandle("data/ship2.png", FileType.Internal), TextureFilter.MipMap,
         TextureFilter.Linear, TextureWrap.ClampToEdge, TextureWrap.ClampToEdge);

I'm probably doing something simple wrong.
tamas305
 
Posts: 108
Joined: Sat Nov 06, 2010 1:51 pm

Re: Issues with Wings3d .obj files not rendering correctly

Postby mzechner » Thu Dec 23, 2010 12:12 am

Yeah, it's probably just something small. A couple of things i need to know/you could try:

- what android device are you running this on?
- what android version are you running this on?

- Check out the SVN trunk, import all projects to Eclipse and run the gdx-tests-android project on your device.
- Select the ObjTest from the list that is shown to you.
- Still no texture?
- Do a clean checkout, do not override any checkout you modified and already have! Use a new workspace for best results :)
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: Issues with Wings3d .obj files not rendering correctly

Postby tamas305 » Thu Dec 23, 2010 12:35 am

My buddy: Samsung Galaxy S running 2.1

I checked out the trunk and all the android-specific folders were complaining about a missing a /gen folder. Cleaning didn't help. I'm using revision 1258.
tamas305
 
Posts: 108
Joined: Sat Nov 06, 2010 1:51 pm

Re: Issues with Wings3d .obj files not rendering correctly

Postby mzechner » Thu Dec 23, 2010 12:53 am

DId you clean all projects? Also what ADT version are you on? There must be something fishy going on :/
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: Issues with Wings3d .obj files not rendering correctly

Postby tamas305 » Thu Dec 23, 2010 1:49 am

Yes, I cleaned all projects and that didn't help. I'm using adt 8.0.1.

Code: Select all
Project 'gdx-tests-android' is missing required source folder: 'gen'



Could it be that I am still exporting the .obj file incorrectly? Could you send me the one that you used?
tamas305
 
Posts: 108
Joined: Sat Nov 06, 2010 1:51 pm

Re: Issues with Wings3d .obj files not rendering correctly

Postby tamas305 » Thu Dec 23, 2010 2:28 am

Okay here's what I've found so far. My .obj file is fine and it renders well (tested it in the desktop version of gdx-invaders).

Now here are the weird parts:

EDIT: In new post
Last edited by tamas305 on Thu Dec 23, 2010 2:49 am, edited 1 time in total.
tamas305
 
Posts: 108
Joined: Sat Nov 06, 2010 1:51 pm

Next

Return to Libgdx

Who is online

Users browsing this forum: diazndc and 1 guest