Models not showing

I can't seem to figure out why a specific model isn't showing. Other models do, but this one doesn't. There's no error when loading it, it just doesn't show up anywhere. I run the same updateRenderState that I do on all other models.



I'm at a loss as to why I can't see it, or tell if it has loaded at all.



Any ideas?

SceneMonitor can help you find whats wrong.

What exporter/importer do you use? I assume you are sure you attached it to the scenegraph. :smiley:

Are you using zBuffer? If you want I can test your model!

I just tried loading your model (gamedisc) using  TestTrianglePick.java  (first example I could find that loads .obj file) and modified just the line that loads the model - and something appeared :slight_smile:



The only obvious difference is I didn't have the .mtl file, so just created a blank one. Try replacing yours with an empty file and see if it makes any difference?

Is there something different with object files that have multiple items in them? In jME 1 it loaded fine, it doesn't seem that way in jME 2. I'm also posting two models. The gamedisc one is the one that doesn't load.



I don't use the mtl files. let me know if i need to post them too.









1.obj

Jul 7, 2009 8:47:22 AM com.jme.scene.Node <init>

INFO: Node created.

Jul 7, 2009 8:47:23 AM com.jme.util.geom.GeometryTool minimizeVerts

INFO: mesh: health (com.jme.scene.TriMesh) old: 32 new: 32

Jul 7, 2009 8:47:23 AM com.jme.scene.Node attachChild

INFO: Child "health" attached to this node "obj file"







gamedisc.obj

Jul 7, 2009 8:46:38 AM com.jmex.model.converters.ObjToJme processLine

INFO: Object:gamedisc

Jul 7, 2009 8:46:38 AM com.jmex.model.converters.ObjToJme processLine

INFO: Object:discart

Jul 7, 2009 8:46:38 AM com.jmex.model.converters.ObjToJme processLine

INFO: Object:charmlevel

Jul 7, 2009 8:46:38 AM com.jmex.model.converters.ObjToJme processLine

INFO: Object:summonlevel

Jul 7, 2009 8:46:38 AM com.jmex.model.converters.ObjToJme processLine

INFO: Object:attack

Jul 7, 2009 8:46:38 AM com.jmex.model.converters.ObjToJme processLine

INFO: Object:movement

Jul 7, 2009 8:46:38 AM com.jmex.model.converters.ObjToJme processLine

INFO: Object:entity

Jul 7, 2009 8:46:38 AM com.jmex.model.converters.ObjToJme processLine

INFO: Object:timeofday

Jul 7, 2009 8:46:38 AM com.jmex.model.converters.ObjToJme processLine

INFO: Object:health

Jul 7, 2009 8:46:38 AM com.jme.scene.Node <init>

INFO: Node created.

Jul 7, 2009 8:46:38 AM com.jme.util.geom.GeometryTool minimizeVerts

INFO: mesh: health (com.jme.scene.TriMesh) old: 14 new: 12

Jul 7, 2009 8:46:38 AM com.jme.scene.Node attachChild

INFO: Child "health" attached to this node "obj file"

Jul 7, 2009 8:46:38 AM com.jme.util.geom.GeometryTool minimizeVerts

INFO: mesh: discart (com.jme.scene.TriMesh) old: 13 new: 13

Jul 7, 2009 8:46:38 AM com.jme.scene.Node attachChild

INFO: Child "discart" attached to this node "obj file"

Jul 7, 2009 8:46:38 AM com.jme.util.geom.GeometryTool minimizeVerts

INFO: mesh: entity (com.jme.scene.TriMesh) old: 4 new: 4

Jul 7, 2009 8:46:38 AM com.jme.scene.Node attachChild

INFO: Child "entity" attached to this node "obj file"

Jul 7, 2009 8:46:39 AM com.jme.util.geom.GeometryTool minimizeVerts

INFO: mesh: gamedisc (com.jme.scene.TriMesh) old: 226 new: 226

Jul 7, 2009 8:46:39 AM com.jme.scene.Node attachChild

INFO: Child "gamedisc" attached to this node "obj file"

Jul 7, 2009 8:46:39 AM com.jme.util.geom.GeometryTool minimizeVerts

INFO: mesh: movement (com.jme.scene.TriMesh) old: 4 new: 4

Jul 7, 2009 8:46:39 AM com.jme.scene.Node attachChild

INFO: Child "movement" attached to this node "obj file"

Jul 7, 2009 8:46:39 AM com.jme.util.geom.GeometryTool minimizeVerts

INFO: mesh: summonlevel (com.jme.scene.TriMesh) old: 4 new: 4

Jul 7, 2009 8:46:39 AM com.jme.scene.Node attachChild

INFO: Child "summonlevel" attached to this node "obj file"

Jul 7, 2009 8:46:39 AM com.jme.util.geom.GeometryTool minimizeVerts

INFO: mesh: timeofday (com.jme.scene.TriMesh) old: 4 new: 4

Jul 7, 2009 8:46:39 AM com.jme.scene.Node attachChild

INFO: Child "timeofday" attached to this node "obj file"

Jul 7, 2009 8:46:39 AM com.jme.util.geom.GeometryTool minimizeVerts

INFO: mesh: attack (com.jme.scene.TriMesh) old: 4 new: 4

Jul 7, 2009 8:46:39 AM com.jme.scene.Node attachChild

INFO: Child "attack" attached to this node "obj file"

Jul 7, 2009 8:46:39 AM com.jme.util.geom.GeometryTool minimizeVerts

INFO: mesh: charmlevel (com.jme.scene.TriMesh) old: 4 new: 4

Jul 7, 2009 8:46:39 AM com.jme.scene.Node attachChild

INFO: Child "charmlevel" attached to this node "obj file"

Jul 7, 2009 8:46:39 AM com.jme.scene.Node <init>

INFO: Node created.






Hmm,…for me it is loading processing all the object but creating only one

object.

you are not using the mtl-files? Ever tried it with? As far as I can see

trimeshs are created for every material. If the material is not know (maybe bacuse

of the lack of mtllib) all is pakced in the default-group. Maybe that is the problem.

Actually I just had a fast look in the coverter so maybe all of this is nonsense.



But nevertheless give it a try with mtl…and plz post here as well so I can have a deep look

in it.

I think the point is that only the disc is loading although there are more than one objects placed in the file.

(You could have comment out the mtllib-part as well)

Well i have plenty to try out. Who knows, maybe it's something else in my game that's preventing the model from loading. or perhaps the method in which i load. I'm off travelling so I have little time to test. I'll either have to wait until monday, or possibly thursday after I get my laptop set up for java development.





but here's what I use to load models:





        final ByteArrayOutputStream BOtmp = new ByteArrayOutputStream();

       

        Future<Spatial> future = GameTaskQueueManager.getManager().update(new Callable<Spatial>() {

            public Spatial call() throws Exception {



                URL urlTmp = getURL(tmCurrentResource.get("url").toString());

                try {

                    converter.setProperty("mtllib", urlTmp);

                    converter.convert(urlTmp.openStream(), BOtmp);



                    Spatial nodeTmp = (Spatial) BinaryImporter.getInstance().load(new ByteArrayInputStream(BOtmp.toByteArray()));

                    nodeTmp.setModelBound(new BoundingBox());

                    nodeTmp.setName(tmCurrentResource.get("id").toString());

                    nodeTmp.updateModelBound();



                    float scale = Float.valueOf(tmCurrentResource.get("scale").toString().trim()).floatValue();

                    nodeTmp.getLocalScale().set(scale,scale,scale);



                    return nodeTmp;

                }catch (Exception e) {

                    parent.log(e);

                }

                return null;



            }

        });

        try {

            Spatial nodeTmp = future.get();

            this.tmModels.put( tmCurrentResource.get("id").toString(), nodeTmp );

        } catch (Exception e) {

            parent.log(e);

        }

i had this problem once, i solved with a little of brute force.



It was a tree, that loaded the leaves and not the trunk, so i made two objects, one for the Leafs and one for the Trunk, now it works fine!

So what's about the mtl-file? Didn't you want to post it if we want to?