Textured 3D
Moderators: Víctor Paredes, slowtiger
-
- Posts: 45
- Joined: Sun Aug 08, 2004 10:58 am
- Location: Los Angeles
Textured 3D
Will 3D objects eventually support textures? If they already do, then I must be doing something wrong...
- Lost Marble
- Site Admin
- Posts: 2354
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
-
- Posts: 45
- Joined: Sun Aug 08, 2004 10:58 am
- Location: Los Angeles
Hmmm... I can't seem to get it to show textures. No matter what I do, the resulting model appears all black.
Does the .obj loader look for an mtl file for material info?
What image file types are supported? I doubt that's it, though---I've tried bmp, jpg and png.
I can e-mail you my test object if you like.
Does the .obj loader look for an mtl file for material info?
What image file types are supported? I doubt that's it, though---I've tried bmp, jpg and png.
I can e-mail you my test object if you like.
- Lost Marble
- Site Admin
- Posts: 2354
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
Ah, if your object appears all black, that's probably because the faces are clockwise. I believe the OBJ specification says faces should be counter-clockwise, but that's obviously not always the case. Double-click the layer in Moho after you've imported it to bring up the Layer Settings dialog, and go to the 3D Options tab. Switch from counter-clockwise to clockwise, or vice versa.
Yes, the OBJ loader is looking for an mtl file. The image type can be JPEG, BMP, PNG, or TGA.
Yes, the OBJ loader is looking for an mtl file. The image type can be JPEG, BMP, PNG, or TGA.
-
- Posts: 45
- Joined: Sun Aug 08, 2004 10:58 am
- Location: Los Angeles
I tried that too. The result goes from all black to all white.
3D file formats always seem to cause problems for applications, and this looks very clearly like some applications are saving the format a little differently than Moho is expecting.
I've saved the same model with two different applications: 3D Exploration and UnWrap3D, both of which have been fairly reliable in situations like this. Both files load correctly in both apps, but not in Moho. Wings3D also loses track of the texture image.
Have a look...
http://www.barliesque.com/misc/3D_egg.zip
Off the subject: Is texture alpha supported for transparency?
Also off the subject: Since OBJ files can contain normal data, why not use normals to determine face orientation if they do exist in the model?
3D file formats always seem to cause problems for applications, and this looks very clearly like some applications are saving the format a little differently than Moho is expecting.
I've saved the same model with two different applications: 3D Exploration and UnWrap3D, both of which have been fairly reliable in situations like this. Both files load correctly in both apps, but not in Moho. Wings3D also loses track of the texture image.
Have a look...
http://www.barliesque.com/misc/3D_egg.zip
Off the subject: Is texture alpha supported for transparency?
Also off the subject: Since OBJ files can contain normal data, why not use normals to determine face orientation if they do exist in the model?
-
- Posts: 45
- Joined: Sun Aug 08, 2004 10:58 am
- Location: Los Angeles
A tip for Carrara users on the Mac:
Be sure to name your shaders in Carrara with the extension appropriate to the texture file format before you export to Wavefront (OBJ). For example, if your shader is called "Texture1" in Carrara, and the texture map is a jpg file, rename the shader to "Texture1.jpg". Also, in the Wavefront export options, make sure that "Write File Names As:" is set to "Name Only". If you don't do these two things, you'll find that Moho won't import your textures, because of a quirk in how Carrara exports OBJ material files.
LM, I noticed some serious texture warping when you rotate the object and move the camera around it. Not a big deal for me, because I'll be using solid fills in all my 3D objects for the forseeable future, but some people might be concerned.
Be sure to name your shaders in Carrara with the extension appropriate to the texture file format before you export to Wavefront (OBJ). For example, if your shader is called "Texture1" in Carrara, and the texture map is a jpg file, rename the shader to "Texture1.jpg". Also, in the Wavefront export options, make sure that "Write File Names As:" is set to "Name Only". If you don't do these two things, you'll find that Moho won't import your textures, because of a quirk in how Carrara exports OBJ material files.
LM, I noticed some serious texture warping when you rotate the object and move the camera around it. Not a big deal for me, because I'll be using solid fills in all my 3D objects for the forseeable future, but some people might be concerned.
Courtesy of: Your Friendly Neighbourhood Armaani
Independent Storyteller, Humourist, Absurdist, and All-’Round Nice Guy
http://armaankhan.blogspot.com
Independent Storyteller, Humourist, Absurdist, and All-’Round Nice Guy
http://armaankhan.blogspot.com
- Lost Marble
- Site Admin
- Posts: 2354
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
Barliesque - That's really odd. I've got your 3D egg file here, and this is how it looks when I import it into Moho:
I tried to re-download your egg, but the file seems to be gone. Did you make changes to the egg? If so, can I try out the new file?
Armaani - You're right about the texture warping. We're currently using a not-so-great texture mapping algorithm. If you can divide your 3D model up into smaller polygons, the problem will become less noticeable. Hopefully we can fix this before version 5 is finished.[/img]
I tried to re-download your egg, but the file seems to be gone. Did you make changes to the egg? If so, can I try out the new file?
Armaani - You're right about the texture warping. We're currently using a not-so-great texture mapping algorithm. If you can divide your 3D model up into smaller polygons, the problem will become less noticeable. Hopefully we can fix this before version 5 is finished.[/img]
-
- Posts: 45
- Joined: Sun Aug 08, 2004 10:58 am
- Location: Los Angeles
That is really odd. I haven't made any changes at all. I get the same results with the U3D version as well.
I must have accidentally delteted the file from the server--I'll upload it again when I get home.
Could you send me another 3D file that loads correctly? It would be interesting to see if I have the same problem with other files as well.
I must have accidentally delteted the file from the server--I'll upload it again when I get home.
Could you send me another 3D file that loads correctly? It would be interesting to see if I have the same problem with other files as well.
- Lost Marble
- Site Admin
- Posts: 2354
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
Here's another textured 3D file that works fine for me here. Let me know if the texture comes out messed up on your computer:
http://www.lostmarble.com/downloads/moh ... mple3D.zip
http://www.lostmarble.com/downloads/moh ... mple3D.zip
-
- Posts: 45
- Joined: Sun Aug 08, 2004 10:58 am
- Location: Los Angeles
-
- Posts: 45
- Joined: Sun Aug 08, 2004 10:58 am
- Location: Los Angeles
Was that helpful? Let me know if you'd like me to do any testing, since this happens on my computer but not yours.
If you want to send me an alternate exe to test with, you can send it to: david@barliesque.com
If you want to send me an alternate exe to test with, you can send it to: david@barliesque.com
- Lost Marble
- Site Admin
- Posts: 2354
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
I don't know - it seems like something must have changed in the file. I can't imagine how it would look so different on our two computers. The file I sent you shows that texture mapping can work on your copy of Moho - that's why I feel like something must have changed in the egg. Can you either upload it somewhere, or send it to support@lostmarble.com? Thanks.
-
- Posts: 45
- Joined: Sun Aug 08, 2004 10:58 am
- Location: Los Angeles
Oh, sorry! I forgot to mention that I'd re-uploaded the egg model.
http://www.barliesque.com/misc/3D_egg.zip
The thing is, though. I definitely haven't changed anything. I just double-checked, and the results are the same.
Usually if things are different from one computer to another, it's down to graphics card drivers. I've got an NVidia FX 5800, and NVidia has had some driver problems to be sure.
My guess is that it's something to do with floating point precision in the UV data. But I can't think of any way that could happen. I haven't got an OBJ inspector to help me offer further suggestions. Obviously there must be *something* different about these files--even if the difference only shows up on my computer.
http://www.barliesque.com/misc/3D_egg.zip
The thing is, though. I definitely haven't changed anything. I just double-checked, and the results are the same.
Usually if things are different from one computer to another, it's down to graphics card drivers. I've got an NVidia FX 5800, and NVidia has had some driver problems to be sure.
My guess is that it's something to do with floating point precision in the UV data. But I can't think of any way that could happen. I haven't got an OBJ inspector to help me offer further suggestions. Obviously there must be *something* different about these files--even if the difference only shows up on my computer.
- Lost Marble
- Site Admin
- Posts: 2354
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
Now that you re-uploaded the file, I can tell you that something definitely did change. The file headers say that one was created by 3D Exploration, and one by Ultimate Unwrap3D.
In the picture below, the left egg is the file you originally uploaded. The egg on the right is the one you most recently linked to.
Here's a copy of your original egg file if you want to take a look:
http://www.lostmarble.com/misc/original_egg.zip
If you look at the U3D OBJ file in a text editor, you'll see that most of the texture coordinates go beyond 1.0. I'm not sure if this is technically allowed in the OBJ file format, but we can update Moho to deal with it. Incidentally, in the X3D OBJ file you uploaded, the texture coordinates go beyond 2, so it seems like one of those programs you're using keeps adding 1 to the texture coordinate. This could start to be a bad thing if you keep working on the same file for a long time.
So, the summary is that yes, the egg file did in fact change, and we'll update Moho to deal with it.
In the picture below, the left egg is the file you originally uploaded. The egg on the right is the one you most recently linked to.
Here's a copy of your original egg file if you want to take a look:
http://www.lostmarble.com/misc/original_egg.zip
If you look at the U3D OBJ file in a text editor, you'll see that most of the texture coordinates go beyond 1.0. I'm not sure if this is technically allowed in the OBJ file format, but we can update Moho to deal with it. Incidentally, in the X3D OBJ file you uploaded, the texture coordinates go beyond 2, so it seems like one of those programs you're using keeps adding 1 to the texture coordinate. This could start to be a bad thing if you keep working on the same file for a long time.
So, the summary is that yes, the egg file did in fact change, and we'll update Moho to deal with it.