New Guy Here. Any Suggestions?

The rootNode variable is defined in the SimpleApplication class. It’s just an ordinary Node. It has protected visibilty and is available in all subclasses to SimpleApplication,

I guess this is the point where you have to look a bit more into java. Theres only so many ways a variable can pop up anywhere :wink:

Okay, I see. I’d figure it’s an ordinary node except that spatials attached get drawn (and exist, although objects can exist without being attached to the rootNode, right?). In any case, I was just pointing it out. It might be nice just to add a little tip saying, “NOTE: The rootNode variable is defined in the SimpleApplication class.” Maybe not. Anyway, thanks again. :slight_smile:

@solarlune said:
It might be nice just to add a little tip saying, "NOTE: The rootNode variable is defined in the SimpleApplication class."


Except to a Java developer, it's like "where else would it have been defined?" If not SimpleApplication then Application... it can't come from anywhere else.

It's tough to decide when documenting how much Java to teach while explaining the tools... especially since Java coders probably wouldn't even think of the question, I guess.

Also, the source is available and browsable even online (and probably in JMP but I don't know because I actually have it all checked out from SVN :)). Don't be afraid to use it. It can even be a way to jump-start Java learning: http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/app/SimpleApplication.java
@pspeed said:
Also, the source is available and browsable even online (and probably in JMP)

You can just right-click any jME3 Class in the editor and select Navigate->Go to Source

I burst forth years later from the pocket dimension once again to attempt to learn JME3. Something about it just doesn’t really work for me; I’m not sure what the problem is or why I seem to have trouble learning it sometimes.

Anyway, I have a somewhat quick question. In the documentation, it’s mentioned that it’s possible to load blend files directly in code by using the blendloader or the blendmodelloader loaders (?). I tried this, but blendloader and blendmodelloader aren’t defined. Are the docs incorrect?

EDIT: As a tip, on looking at the material-related FAQ page, it seems like it skips the most useful use case: where you already have a textured 3D model and wish to access its material to edit it. I know it’s possible (and possibly trivial) to do, but I think it’d be a useful case to add to the “How to use Materials” page).

EDIT 2: Are the docs, uh, “okay”? It seems like they might be incorrect in some ways. For example, the “How do I access a named sub-mesh in Model?” FAQ question points to basically getting a portion of the name of a spatial, I think…? (OK, I think I see what’s supposed to be going on, but I think it’s still wrong.)The similar question in the linked Spatial page gives (what I assume) is the correct answer, which is to cast a spatial as geometry and then use its “getChild()” function…? Unless they’re asking two different questions in almost the same way and presenting the answer using two different methods?

@solarlune said: EDIT 2: Are the docs, uh, "okay"? It seems like they might be incorrect in some ways. For example, the "How do I access a named sub-mesh in Model?" FAQ question points to basically getting a portion of the name of a spatial, I think...?

Yeah, that looked strange. I edited it to look like the explanation in the linked page (it’s a wiki so anyone can make it better).

1 Like
I burst forth years later from the pocket dimension once again to attempt to learn JME3. Something about it just doesn’t really work for me; I’m not sure what the problem is or why I seem to have trouble learning it sometimes

@solarlune
I feel the pain man, I too am trying to learn JME3…So far I find some of the documentation confusing…As far as Blender goes, I just import the model and load the .j3o file with code…I am working on learning more about java right now…It is a slightly different language than others that I have learned…Hang in there…

@CreativeOcclusion said: @solarlune I feel the pain man, I too am trying to learn JME3....So far I find some of the documentation confusing...As far as Blender goes, I just import the model and load the .j3o file with code....I am working on learning more about java right now...It is a slightly different language than others that I have learned....Hang in there....

Thanks. It can be frustrating, for sure, especially when things don’t seem to have any logical sequence of events.

The current problem I’m struggling with is that Ambient lights don’t seem to light up my models at all under any circumstances. It’s weird - I was using the Blender loader (the jme3.libraries.blender library) to load my model so I wouldn’t have to convert to j3o, but it didn’t seem to work effectively. It seemed like it was splitting my meshes up in an odd manner, and the meshes weren’t all reacting to the right lights. So, I tried j3o alone, but no matter what, the ambient lighting isn’t working. Relevant code:

[java]
public void createWorld(){

        Node world = (Node) assetManager.loadModel("Models/world.j3o");

        Node player = (Node) assetManager.loadModel("Models/player.j3o");
                              
        rootNode.attachChild(world);
        
        current_world = world;
        
        for (Light light : rootNode.getLocalLightList()){ // Remove existing lights
            
            rootNode.removeLight(light);
            
        }
        
        AmbientLight ambient = new AmbientLight();
        ambient.setColor(ColorRGBA.White.mult(2.0f));
        rootNode.addLight(ambient);
        
    }[/java] 

But nothing doing. Any ideas?

Probably your material has no ambient component. Open the model in the scene editor, ‘generate’ it’s material (j3m file) so you can edit it. Give it some ambient.