Problems loading Sketchup .obj+.mtl files (noob)

Hi, complete newbie to JME, LWGL, and gaming. Having real problems loading Sketchup material files. Hope someone here can help.



I'm hoping to use Sketchup for graphical model-building, then animate the models with Java+JME. Situation is: can load Sketchup models (.obj files) fine, but the materials file (.mtl) appears to be loaded properly, but ignored. End result is ugly, with what seems to be artificially generated textures (mostly black) used instead of the .mtl file contents.



The maggie demo loads fine. But I gather it uses textures rather than materials.



Here's the code I'm using. The commented out section seems to make no difference.



The .obj and .mtl files (from ./models) will follow:


package nagumo;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.URL;

import com.jme.app.SimpleGame;
import com.jme.light.PointLight;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.Node;
import com.jme.scene.state.LightState;
import com.jmex.model.XMLparser.BinaryToXML;
import com.jmex.model.XMLparser.JmeBinaryReader;
import com.jmex.model.XMLparser.Converters.FormatConverter;
import com.jmex.model.XMLparser.Converters.ObjToJme;

public class Main extends SimpleGame
{
   ModelNode bomb;

   protected void simpleInitGame()
   {
      try
      {
      display.getRenderer().setBackgroundColor(ColorRGBA.white);

         this.bomb = new ModelNode("Bomb.obj");
         rootNode.updateRenderState();
   }
      catch (IOException e)
      {
         System.out.println("Damn exceptions!" + e);
         e.printStackTrace();
      }
   }
   public static void main(String[] args)
   {
      Main main = new Main();
      main.start();
   }
   class ModelNode
   {
      final Node node;
      ModelNode(String file) throws IOException
      {
         URL url = Main.class.getClassLoader().getResource(file);
         FormatConverter converter = new ObjToJme();
         converter.setProperty("mtllib", url);
         converter.setProperty("texurl", url);

         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         JmeBinaryReader jbr = new JmeBinaryReader();

         BinaryToXML btx = new BinaryToXML();
         OutputStreamWriter osw = new OutputStreamWriter(System.out);
         converter.convert(url.openStream(), bos);

         ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
         btx.sendBinarytoXML(bis, osw);
         jbr.setProperty("bound", "box");

         this.node = new Node(file);
         bis = new ByteArrayInputStream(bos.toByteArray());
         jbr.loadBinaryFormat(node, bis);
         node.setLocalScale(10f);
         node.setName(file);
         // node.setModelBound(new BoundingBox());

//          URL textureURL = NagumoSim.class.getClassLoader().getResource("Monkey.tga");
//          TextureState textureState = display.getRenderer().createTextureState();
//          Texture texture = TextureManager.loadTexture(textureURL,
//          Texture.MM_LINEAR, Texture.FM_LINEAR, 1f, true);
//          textureState.setTexture(texture);
//          node.setRenderState(textureState);
//         
//          MaterialState materialState = display.getRenderer().createMaterialState();
//          materialState.setEmissive(new ColorRGBA(0f,.2f,0f,1));
//          node.setRenderState(materialState);
         
          LightState ls = display.getRenderer().createLightState();
          PointLight light = new PointLight();
          light.setLocation(new Vector3f(0,10,5));
          light.setDiffuse(ColorRGBA.red);
          light.setEnabled(true);
          ls.attach(light);
          lightState.detachAll();
          node.setRenderState(ls);

         rootNode.attachChild(node);
      }
   }
}



Here's the ./models/.obj file:


Sigh. Deleted. The message exceeds the maximum allowed length (20000 characters).



And the ./models/Bomb.mdl file


Sigh. Deleted. The message exceeds the maximum allowed length (20000 characters).

Well, 18 views but 0 responses. Maybe uploading the .obj and .mdl files will help generate some help.



The code expects these directly in the classpath, not subdirectories.


#
## Alias OBJ Material File
# Exported from SketchUp, (c) 2000-2005 @Last Software, Inc.

newmtl FrontColor
Ka 0.000000 0.000000 0.000000
Kd 0.882353 0.882353 0.784314
Ks 0.330000 0.330000 0.330000

newmtl BackColor
Ka 0.000000 0.000000 0.000000
Kd 0.501961 0.501961 0.784314
Ks 0.330000 0.330000 0.330000

newmtl Material1_
Ka 0.000000 0.000000 0.000000
Kd 0.501961 0.501961 0.000000
Ks 0.330000 0.330000 0.330000

newmtl Material3_
Ka 0.000000 0.000000 0.000000
Kd 0.603922 0.600000 0.000000
Ks 0.330000 0.330000 0.330000

newmtl Material2_
Ka 0.000000 0.000000 0.000000
Kd 1.000000 1.000000 0.000000
Ks 0.330000 0.330000 0.330000



And the .obj file, if it fits (is this site really that short of RAM? 20K? Sheesh).

# Alias OBJ Model File
# Exported from SketchUp, (c) 2000-2005 @Last Software, Inc.
# File units = feet

mtllib Bomb.mtl

g Group2223 Group_24767 Model

usemtl Material1_
v 3.612 -1.4287 -1.10347
vt 10.5512 -2.07083e-34
vn 0.707107 -6.27641e-18 0.707107
v 3.15814 -0.279095 -0.649602
vt 0 18.8976
v 3.15814 -1.4287 -0.649602
vt 0 0
f 1/1/1 2/2/1 3/3/1
v 3.39841 0.442067 -0.889878
vt 5.58579 30.7524
f 2/2/1 1/1/1 4/4/1
v 3.39841 0.65768 -0.889878
vt 5.58579 34.2967
f 4/4/1 1/1/1 5/5/1
v 3.612 -0.288675 -1.10347
vt 10.5512 18.7402
f 5/5/1 1/1/1 6/6/1

usemtl Material1_
vn -0.707107 6.27641e-18 -0.707107
f 3/3/2 2/2/2 1/1/2
f 4/4/2 1/1/2 2/2/2
f 5/5/2 1/1/2 4/4/2
f 6/6/2 1/1/2 5/5/2

l 2 3

l 3 1

l 1 6

l 5 6

l 4 5

l 2 4

g Group2224 Group_24767 Model

usemtl Material1_
v 2.01629 -1.4287 -1.10347
vn 0.707107 -6.27641e-18 -0.707107
v 2.47015 -0.279095 -0.649602
v 2.47015 -1.4287 -0.649602
f 7/1/3 8/2/3 9/3/3
v 2.22988 0.442067 -0.889878
f 8/2/3 7/1/3 10/4/3
v 2.22988 0.65768 -0.889878
f 10/4/3 7/1/3 11/5/3
v 2.01629 -0.288675 -1.10347
f 11/5/3 7/1/3 12/6/3

usemtl Material1_
vn -0.707107 6.27641e-18 0.707107
f 9/3/4 8/2/4 7/1/4
f 10/4/4 7/1/4 8/2/4
f 11/5/4 7/1/4 10/4/4
f 12/6/4 7/1/4 11/5/4

l 8 9

l 9 7

l 7 12

l 11 12

l 10 11

l 8 10

g Group2225 Group_24767 Model

usemtl Material1_
v 3.612 -1.4287 0.492247
vn -0.707107 -6.27641e-18 0.707107
v 3.15814 -0.279095 0.0383811
v 3.15814 -1.4287 0.0383811
f 13/1/5 14/2/5 15/3/5
v 3.39841 0.442067 0.278658
f 14/2/5 13/1/5 16/4/5
v 3.39841 0.65768 0.278658
f 16/4/5 13/1/5 17/5/5
v 3.612 -0.288675 0.492247
f 17/5/5 13/1/5 18/6/5

usemtl Material1_
vn 0.707107 6.27641e-18 -0.707107
f 15/3/6 14/2/6 13/1/6
f 16/4/6 13/1/6 14/2/6
f 17/5/6 13/1/6 16/4/6
f 18/6/6 13/1/6 17/5/6

l 14 15

l 15 13

l 13 18

l 17 18

l 16 17

l 14 16

g Group2226 Group_24767 Model

usemtl Material1_
v 3.15814 -0.279095 -0.649602
v 3.15814 -1.4287 -0.649602
f 1/1/1 19/2/1 20/3/1
v 3.39841 0.442067 -0.889878
f 19/2/1 1/1/1 21/4/1
v 3.39841 0.65768 -0.889878
f 21/4/1 1/1/1 22/5/1
f 22/5/1 1/1/1 6/6/1

usemtl Material1_
f 20/3/2 19/2/2 1/1/2
f 21/4/2 1/1/2 19/2/2
f 22/5/2 1/1/2 21/4/2
f 6/6/2 1/1/2 22/5/2

l 19 20

l 20 1

l 1 6

l 22 6

l 21 22

l 19 21

g Group2227 Group_24767 Model

usemtl Material1_
v 2.01629 -1.4287 0.492247
vn -0.707107 -6.27641e-18 -0.707107
v 2.47015 -0.279095 0.0383811
v 2.47015 -1.4287 0.0383811
f 23/1/7 24/2/7 25/3/7
v 2.22988 0.442067 0.278658
f 24/2/7 23/1/7 26/4/7
v 2.22988 0.65768 0.278658
f 26/4/7 23/1/7 27/5/7
v 2.01629 -0.288675 0.492247
f 27/5/7 23/1/7 28/6/7

usemtl Material1_
vn 0.707107 6.27641e-18 0.707107
f 25/3/8 24/2/8 23/1/8
f 26/4/8 23/1/8 24/2/8
f 27/5/8 23/1/8 26/4/8
f 28/6/8 23/1/8 27/5/8

l 24 25

l 25 23

l 23 28

l 27 28

l 26 27

l 24 26

g Group_24767 Model

usemtl Material3_
v 3.3785 4.46078 -0.45683
vt 1.8438 10.3925
vn -0.682913 -0.70721 0.182986
v 3.17193 4.59209 -0.51218
vt -1.08911 9.70929
vn -0.432917 -0.866089 0.249945
v 3.32014 4.46078 -0.597744
vt 1.27405 8.65314
vn -0.612283 -0.70721 0.353502
f 29/7/9 30/8/10 31/9/11
v 3.21321 4.59209 -0.412539
vt -0.68623 10.9392
vn -0.482856 -0.866089 0.129381
f 30/8/10 29/7/9 32/10/12

usemtl Material1_
vn 0.612283 0.70721 -0.353502
vn 0.432917 0.866089 -0.249945
vn 0.682913 0.70721 -0.182986
f 31/9/13 30/8/14 29/7/15
vn 0.482856 0.866089 -0.129381
f 32/10/16 29/7/15 30/8/14

usemtl Material3_
vt 16.1289 4.73595
v 2.99935 4.67464 -0.412539
vt 13.3781 4.73595
vn -0.224082 -0.965945 0.129374
vt 15.6669 3.52702
f 32/11/12 33/12/17 30/13/10
v 3.02071 4.67464 -0.36096
vt 13.6173 5.36173
vn -0.249931 -0.965945 0.0669689
f 33/12/17 32/11/12 34/14/18

usemtl Material1_
vn 0.224082 0.965945 -0.129374
f 30/13/14 33/12/19 32/11/16
vn 0.249931 0.965945 -0.0669689
f 34/14/20 32/11/16 33/12/19

usemtl Material3_
v 3.58507 4.09037 -0.51218
vt -42.5836 13.0835
vn -0.932995 -0.258889 0.249995
v 3.52972 3.87652 -0.71875
vt -40.1354 10.4043
vn -0.858616 -0.130526 0.495722
v 3.61227 3.87652 -0.519467
vt -39.9969 12.989
vn -0.957662 -0.130526 0.256605
f 35/15/21 36/16/22 37/17/23
v 3.50534 4.09037 -0.704673
vt -42.7174 10.5869
vn -0.8365 -0.258889 0.482954
f 36/16/22 35/15/21 38/18/24

usemtl Material1_
vn 0.957662 0.130526 -0.256605
vn 0.858616 0.130526 -0.495722
vn 0.932995 0.258889 -0.249995
f 37/17/25 36/16/26 35/15/27
vn 0.8365 0.258889 -0.482954
f 38/18/28 35/15/27 36/16/26

usemtl Material3_
v 3.50534 4.28966 -0.490816
vt -29.9523 15.5
vn -0.836455 -0.500109 0.224128
vt -27.7671 12.756
vt -27.3785 15.2259
f 39/19/29 38/20/24 35/21/21
v 3.43385 4.28966 -0.6634
vt -30.3008 13.2856
vn -0.749945 -0.500109 0.432981
f 38/20/24 39/19/29 40/22/30

usemtl Material1_
vn 0.836455 0.500109 -0.224128
f 35/21/27 38/20/28 39/19/31
vn 0.749945 0.500109 -0.432981
f 40/22/32 39/19/31 38/20/28

usemtl Material3_
vt -15.5514 14.6739
vn -0.682913 -0.70721 0.182986
vt -13.544 12.0714
vn -0.749945 -0.500109 0.432981
vt -12.9987 14.2458
f 29/23/33 40/24/34 39/25/29
vt -15.9967 12.8986
vn -0.612283 -0.70721 0.353502
f 40/24/34 29/23/33 31/26/35

usemtl Material1_
vn 0.749945 0.500109 -0.432981
vn 0.682913 0.70721 -0.182986
f 39/25/31 40/24/36 29/23/37
vn 0.612283 0.70721 -0.353502
f 31/26/38 29/23/37 40/24/36

usemtl Material3_
v 3.52972 4.28966 -0.30561
vt -31.3483 3.46289
vn -0.865962 -0.500109 -1.51437e-16
vt -28.8848 0.965778
v 3.61227 4.09037 -0.30561
vt -28.7599 3.46289
vn -0.965907 -0.258889 -1.86937e-16
f 41/27/39 35/28/21 42/29/40
vt -31.4603 1.22404
f 35/28/21 41/27/39 39/30/29

usemtl Material1_
vn 0.965907 0.258889 1.86937e-16
vn 0.865962 0.500109 1.51437e-16
f 42/29/41 35/28/27 41/27/42
f 39/30/31 41/27/42 35/28/27

usemtl Material3_
v 3.39841 4.46078 -0.30561
vt -17.6419 3.09864
vn -0.707003 -0.70721 -7.38047e-17
vt -15.2316 0.864086
vt -15.0534 3.09864
vn -0.865962 -0.500109 -1.47915e-16
f 43/31/43 39/32/29 41/33/44
vt -17.7873 1.27413
vn -0.682913 -0.70721 0.182986
f 39/32/29 43/31/43 29/34/45

usemtl Material1_
vn 0.865962 0.500109 1.47915e-16
vn 0.707003 0.70721 7.38047e-17
f 41/33/46 39/32/31 43/31/47
vn 0.682913 0.70721 -0.182986
f 29/34/48 43/31/47 39/32/31

usemtl Material3_
vt -0.232929 1.7204
vn -0.707003 -0.70721 -7.38047e-17
vt -2.95538 0.433148
vt -0.422463 -0.10005
vn -0.682913 -0.70721 0.182986
f 43/35/49 32/36/12 29/37/50
v 3.22728 4.59209 -0.30561
vt -2.82136 1.7204
vn -0.49989 -0.866089 1.05216e-17
f 32/36/12 43/35/49 44/38/51

usemtl Material1_
vn 0.682913 0.70721 -0.182986
vn 0.707003 0.70721 7.38047e-17
f 29/37/52 32/36/16 43/35/53
vn 0.49989 0.866089 -1.05216e-17
f 44/38/54 43/35/53 32/36/16

usemtl Material3_
vt 14.6916 -0.355271
vn -0.49989 -0.866089 7.01442e-18
vt 12.0224 -1.02032
vt 14.5356 -1.64004
f 44/39/55 34/40/18 32/41/12
v 3.028 4.67464 -0.30561
vt 12.1032 -0.355271
vn -0.258748 -0.965945 -3.32677e-17
f 34/40/18 44/39/55 45/42/56

usemtl Material1_
vn 0.49989 0.866089 -7.01442e-18
f 32/41/16 34/40/20 44/39/57
vn 0.258748 0.965945 3.32677e-17
f 45/42/58 44/39/57 34/40/20

usemtl Material3_
v 2.81414 4.7028 -0.30561
vt 26.1148 -2.62973
vn 0.0419953 -0.999118 -5.18694e-17
vt 28.6165 -3.29403
vt 28.7032 -2.62973
vn -0.258748 -0.965945 -3.41431e-17
f 46/43/59 34/44/18 45/45/60

usemtl Material1_
vn 0.258748 0.965945 3.41431e-17
vn -0.0419953 0.999118 5.18694e-17
f 45/45/61 34/44/20 46/43/62

usemtl Material3_
v 3.61227 0.442067 -0.519467
vt -24.294 6.7352
vn -0.873786 0.426241 0.23413
v 3.23545 -0.279095 -0.548849
vt -14.5308 6.35931
vn -0.783415 0.426241 0.452305
v 3.28405 -0.279095 -0.43152
vt -14.7939 7.86036
f 47/46/63 48/47/64 49/48/63
v 3.52972 0.442067 -0.71875
vt -23.8471 4.18566
f 48/47/64 47/46/63 50/49/64

usemtl Material1_
vn 0.873786 -0.426241 -0.23413
vn 0.783415 -0.426241 -0.452305
f 49/48/65 48/47/66 47/46/65
f 50/49/66 47/46/65 48/47/66

usemtl Material3_
vt -46.5182 10.8292
vn -0.965926 9.61155e-16 0.258819
v 3.52972 3.6365 -0.71875
vt -43.638 8.24074
vn -0.866025 7.84364e-16 0.5
v 3.61227 3.6365 -0.519467
vt -43.638 10.8292
f 37/50/67 51/51/68 52/52/67
vt -46.5182 8.24074
f 51/51/68 37/50/67 36/53/68

usemtl Material2_
vn 0.965926 -9.61155e-16 -0.258819
vn 0.866025 -7.84364e-16 -0.5
f 52/52/69 51/51/70 37/50/69
f 36/53/70 37/50/69 51/51/70

usemtl Material3_
vt 29.1129 2.51116
vn 0.0419953 -0.999118 -5.5949e-17
v 2.92107 4.67464 -0.490816
vt 30.4191 0.276478
vn -0.129374 -0.965945 0.224082
v 2.96536 4.67464 -0.45683
vt 30.9488 0.68655
vn -0.182962 -0.965945 0.182962
f 46/54/71 53/55/72 54/56/73

usemtl Material1_
vn 0.182962 0.965945 -0.182962
vn 0.129374 0.965945 -0.224082
vn -0.0419953 0.999118 5.5949e-17
f 54/56/74 53/55/75 46/54/76

usemtl Material3_
v 2.60029 3.87652 -1.10373
vt -31.2035 -13.2448
vn 0 1 0
v 3.028 3.87652 -1.10373
vt -36.336 -13.2448
v 2.81414 3.87652 -1.13189
vt -33.7697 -13.5827
f 55/57/77 56/58/77 57/59/77
v 2.40101 3.87652 -1.02119
vt -28.8121 -12.2543
f 56/58/77 55/57/77 58/60/77
v 3.22728 3.87652 -1.02119
vt -38.7274 -12.2543
f 56/58/77 58/60/77 59/61/77
v 3.39841 3.87652 -0.889878
vt -40.781 -10.6785
f 59/61/77 58/60/77 60/62/77
v 2.22988 3.87652 -0.889878
vt -26.7585 -10.6785
f 60/62/77 58/60/77 61/63/77
vt -42.3567 -8.625
f 60/62/77 61/63/77 36/64/77
v 2.09857 3.87652 -0.71875
vt -25.1828 -8.625
f 36/64/77 61/63/77 62/65/77
vt -43.3472 -6.23361
f 36/64/77 62/65/77 37/66/77
v 2.01602 3.87652 -0.519467
vt -24.1922 -6.23361
f 37/66/77 62/65/77 63/67/77
v 3.64042 3.87652 -0.30561
vt -43.6851 -3.66732
f 37/66/77 63/67/77 64/68/77
v 1.98787 3.87652 -0.30561
vt -23.8544 -3.66732
f 64/68/77 63/67/77 65/69/77
v 2.01602 3.87652 -0.0917534
vt -24.1922 -1.10104
f 64/68/77 65/69/77 66/70/77
v 3.61227 3.87652 -0.0917534
vt -43.3472 -1.10104
f 64/68/77 66/70/77 67/71/77
v 3.52972 3.87652 0.10753
vt -42.3567 1.29035
f 67/71/77 66/70/77 68/72/77
v 2.09857 3.87652 0.10753
vt -25.1828 1.29035
f 68/72/77 66/70/77 69/73/77
v 3.39841 3.87652 0.278658
vt -40.781 3.34389
f 68/72/77 69/73/77 70/74/77
v 2.22988 3.87652 0.278658
vt -26.7585 3.34389
f 70/74/77 69/73/77 71/75/77
v 2.40101 3.87652 0.409969
vt -28.8121 4.91963
f 70/74/77 71/75/77 72/76/77
v 3.22728 3.87652 0.409969
vt -38.7274 4.91963
f 70/74/77 72/76/77 73/77/77
v 3.028 3.87652 0.492514
vt -36.336 5.91017
f 73/77/77 72/76/77 74/78/77
v 2.60029 3.87652 0.492514
vt -31.2035 5.91017
f 74/78/77 72/76/77 75/79/77
v 2.81414 3.87652 0.520669
vt -33.7697 6.24803
f 74/78/77 75/79/77 76/80/77

usemtl Material3_
vn -0 -1 -0
f 57/59/78 56/58/78 55/57/78
f 58/60/78 55/57/78 56/58/78
f 59/61/78 58/60/78 56/58/78
f 60/62/78 58/60/78 59/61/78
f 61/63/78 58/60/78 60/62/78
f 36/64/78 61/63/78 60/62/78
f 62/65/78 61/63/78 36/64/78
f 37/66/78 62/65/78 36/64/78
f 63/67/78 62/65/78 37/66/78
f 64/68/78 63/67/78 37/66/78
f 65/69/78 63/67/78 64/68/78
f 66/70/78 65/69/78 64/68/78
f 67/71/78 66/70/78 64/68/78
f 68/72/78 66/70/78 67/71/78
f 69/73/78 66/70/78 68/72/78
f 70/74/78 69/73/78 68/72/78
f 71/75/78 69/73/78 70/74/78
f 72/76/78 71/75/78 70/74/78
f 73/77/78 72/76/78 70/74/78
f 74/78/78 72/76/78 73/77/78
f 75/79/78 72/76/78 74/78/78
f 76/80/78 75/79/78 74/78/78

usemtl Material3_
v 3.64042 0.442067 -0.30561
vt -23.4191 0.764347
vn -0.90461 0.426241 2.44578e-16
vt -13.7679 -0.757245
v 3.30062 -0.279095 -0.30561
vt -13.8527 0.764347
f 77/81/79 49/82/63 78/83/79
vt -23.2751 -1.82007
f 49/82/63 77/81/79 47/84/63

usemtl Material1_
vn 0.90461 -0.426241 -2.44578e-16
f 78/83/80 49/82/65 77/81/80
f 47/84/65 77/81/80 49/82/65

usemtl Material3_
vt -46.5182 2.0661
vn -1 1.35683e-15 -6.71882e-16
vt -43.638 -0.522326
v 3.64042 3.6365 -0.30561
vt -43.638 2.0661
f 64/85/81 52/86/67 79/87/81
vt -46.5182 -0.522326
f 52/86/67 64/85/81 37/88/67

usemtl Material2_
vn 1 -1.35683e-15 6.71882e-16
f 79/87/82 52/86/69 64/85/82
f 37/88/69 64/85/82 52/86/69

usemtl Material3_
vt -43.0066 2.75511
vn -0.965907 -0.258889 -1.90465e-16
vt -40.4623 0.167057
vt -40.4182 2.75511
vn -0.991445 -0.130526 -1.81942e-16
f 42/89/83 37/90/23 64/91/84
vt -43.0492 0.255243
f 37/90/23 42/89/83 35/92/21

usemtl Material1_
vn 0.991445 0.130526 1.81942e-16
vn 0.965907 0.258889 1.90465e-16
f 64/91/85 37/90/25 42/89/86
f 35/92/27 42/89/86 37/90/25

usemtl Material3_
vt 26.6467 -0.633909
vn 0.0419953 -0.999118 -5.39092e-17
vt 28.8937 -1.91868
vn -0.224082 -0.965945 0.129374
vt 29.1482 -1.29896
vn -0.249931 -0.965945 0.0669689
f 46/93/87 33/94/88 34/95/89

usemtl Material1_
vn 0.249931 0.965945 -0.0669689
vn 0.224082 0.965945 -0.129374
vn -0.0419953 0.999118 5.39092e-17
f 34/95/90 33/94/91 46/93/92

usemtl Material3_
vt -26.0632 11.4518
v 3.15814 -0.279095 -0.649602
vt -16.3435 12.4466
vn -0.639656 0.426241 0.639656
vt -16.8142 13.896
f 50/96/64 80/97/93 48/98/64
v 3.39841 0.442067 -0.889878
vt -25.2637 8.98997
f 80/97/93 50/96/64 81/99/93

usemtl Material1_
vn 0.639656 -0.426241 -0.639656
f 48/98/66 80/97/94 50/96/66
f 81/99/94 50/96/66 80/97/94

usemtl Material3_
vt -46.5182 18.9424
v 3.39841 3.6365 -0.889878
vt -43.638 16.354
vn -0.707107 1.66811e-16 0.707107
vt -43.638 18.9424
f 36/100/68 82/101/95 51/102/68
vt -46.5182 16.354
f 82/101/95 36/100/68 60/103/95

usemtl Material2_
vn 0.707107 -1.66811e-16 -0.707107
f 51/102/70 82/101/96 36/100/70
f 60/103/96 36/100/70 82/101/96

usemtl Material3_
vt -41.6046 23.1232
vn -0.8365 -0.258889 0.482954
vt -39.2806 20.3356
vn -0.701057 -0.130526 0.701057
vt -39.0248 22.9113
f 38/104/97 60/105/98 36/106/22
v 3.3785 4.09037 -0.86997
vt -41.8517 20.6352
vn -0.682999 -0.258889 0.682999
f 60/105/98 38/104/97 83/107/99

usemtl Material1_
vn 0.701057 0.130526 -0.701057
vn 0.8365 0.258889 -0.482954
f 36/106/26 60/105/100 38/104/101
vn 0.682999 0.258889 -0.682999
f 83/107/102 38/104/101 60/105/100

usemtl Material3_
vt -26.7718 27.354
vn -0.749945 -0.500109 0.432981
vt -24.9534 24.3544
vn -0.682999 -0.258889 0.682999
vt -24.2537 26.7547
f 40/108/103 83/109/104 38/110/24
v 3.32014 4.28966 -0.811601
vt -27.3991 25.202
vn -0.612328 -0.500109 0.612328
f 83/109/104 40/108/103 84/111/105

usemtl Material1_
vn 0.682999 0.258889 -0.682999
vn 0.749945 0.500109 -0.432981
f 38/110/28 83/109/106 40/108/107
vn 0.612328 0.500109 -0.612328
f 84/111/108 40/108/107 83/109/106

usemtl Material3_
vt -11.0608 25.6078
vt -9.57865 22.6742
vt -8.63415 24.7071
f 31/112/11 84/113/105 40/114/34
v 3.22728 4.46078 -0.71875
vt -11.832 23.9479
vn -0.499927 -0.70721 0.499927
f 84/113/105 31/112/11 85/115/109

usemtl Material1_
f 40/114/36 84/113/108 31/112/13
vn 0.499927 0.70721 -0.499927
f 85/115/110 31/112/13 84/113/108

usemtl Material3_
vt 5.94293 18.1075
v 3.10628 4.59209 -0.597744
vt 2.93149 18.1075
vn -0.353475 -0.866089 0.353475
vt 4.99342 16.5428
vn -0.499927 -0.70721 0.499927
f 31/116/11 86/117/111 85/118/112
vt 3.6029 19.214
f 86/117/111 31/116/11 30/119/10

usemtl Material1_
vn 0.499927 0.70721 -0.499927
vn 0.353475 0.866089 -0.353475
f 85/118/113 86/117/114 31/116/13
f 30/119/14 31/116/13 86/117/114

usemtl Material3_
vt 18.793 9.11095
vt 16.1284 9.79423
vn -0.182962 -0.965945 0.182962
vt 18.0452 8.05468
vn -0.353475 -0.866089 0.353475
f 30/120/10 54/121/115 86/122/116
vt 16.5155 10.341
f 54/121/115 30/120/10 33/123/17

Nope, won't fit. Pruning here. This is SERIOUSLY annoying.

.obj/.mlt is the wavefront alias format. note that it doesn't support animations.

it might be easier for you if you would post a link to the files  :expressionless:



one thing i noticed is that you use the material file as texture hint. the obj loader/converter doesn't use such a texture hint. either you edit the .mtl file to point to the right directory, or you put the textures in the same directory whith the .obj and .mtl file.

Not sure what you mean by "use material file as texture hint". The only code related to textures is commented out, and it made no difference in or out. I don't plan to use textures, just materials.



Also don't understand "doesn't support animations". Once loaded and chewed on by JmeLoader,

how would the aniimator know from whence the node came? And if not animation, surely it supports

motion commands, which is all I mean by animation. I want to load them and move them around

with explicit motion calls from my code. Don't plan to use canned animation routines.



The two data files are now at

http://virtualschool.edu/Bomb.obj and

http://virtualschool.edu/Bomb.mtl



I hope someone can help soon; I'm really stuck on this, and on a short deadline. 

The main part of Your bomb seems all right over here but the winglets? are not lit correctly.

Try flipping normals for them or build of two faces each pointing normals outward.

…there seem to be some unneeded geometry inside btw.



edit: ah, and the .mtl file has to be in Your classpath and try to copy the loading part from TestObjJmeWrite



hth

whan i said that obj doesn't support animations i meant that you can't save animation data in obj files. ofcourse you may do anything you want with the model after you load it in your program.

by texture hint i meant : converter.setProperty("texurl", url);

that line has no effect.

there are some wrong things about your model:


  • your bomb model has an inside. quite much of an inside i would say. there are a lot of polys on the inside of the model, which one will never see, but which will be processed jme(and opengl). it seems like you have wa too much geometry (~1900+ triangles). that's very much for a bomb (unless the bomb is very important in your game) ;)

  • your model is not centered (you might wonder later why the bomb doesn't strike at the location it's supposed to strike at)

  • you use very sharp triangles (very bad for texturing - if you intend to texture your model)

  • there seems to be something wrong whith the normals, but i'm not sure what it is. i'm currently at work, but when i get home i can take a closer look



if you want, i can redo that bomb model for you this evening. it's quite simple. just tell me how detailed you want it to be :P